21
1
Fork 0
mirror of https://github.com/Evolix/chexpire.git synced 2024-05-04 17:55:11 +02:00

Checks form: do not ask for created at anymore

This commit is contained in:
Colin Darie 2018-05-30 18:15:56 +02:00
parent 62a53314c5
commit 1179a10775
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
4 changed files with 4 additions and 4 deletions

View file

@ -40,7 +40,6 @@ class Check < ApplicationRecord
validates :kind, presence: true
validates :domain, presence: true
validates :domain_created_at, presence: true
validate :domain_created_at_past
validate :domain_updated_at_past
validates :comment, length: { maximum: 255 }

View file

@ -5,7 +5,6 @@
<%= f.input :kind, as: :radio_buttons, collection: Check.kinds.keys if check.new_record? %>
<% end %>
<%= f.input :domain_created_at, as: :date, start_year: 1990, end_year: Date.today.year %>
<%= f.input :comment %>
<%= f.input :vendor %>

View file

@ -2,7 +2,9 @@
<div class="mb-4">
<div>Domain: <%= check.domain %></div>
<div>Kind: <%= check.kind %></div>
<div>Date de création: <%= check.domain_created_at.to_date %></div>
<div>Created date: <%= l(check.domain_created_at.to_date) if check.domain_created_at.present? %></div>
<div>Update date: <%= l(check.domain_updated_at.to_date) if check.domain_updated_at.present? %></div>
<div>Expire date: <%= l(check.domain_expire_at.to_date) if check.domain_expire_at.present? %></div>
<% if check.comment? %>
<div>Comment: <%= check.comment %></div>

View file

@ -8,7 +8,7 @@
</div>
<div class="row mt-5 justify-content-center">
<div class="col-12 col-lg-8">
<div class="col-12 col-lg-10">
<%= button_to("Delete", check_path(@check), class: "btn btn-danger", method: :delete,
data: { confirm: "Are you sure ?" }) %>
</div>