diff --git a/app/models/check.rb b/app/models/check.rb index 2276dbe..f3bbbd4 100644 --- a/app/models/check.rb +++ b/app/models/check.rb @@ -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 } diff --git a/app/views/checks/_form.html.erb b/app/views/checks/_form.html.erb index 79be782..ffd7c39 100644 --- a/app/views/checks/_form.html.erb +++ b/app/views/checks/_form.html.erb @@ -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 %> diff --git a/app/views/checks/_table.html.erb b/app/views/checks/_table.html.erb index 7fdf93c..a25efbd 100644 --- a/app/views/checks/_table.html.erb +++ b/app/views/checks/_table.html.erb @@ -2,7 +2,9 @@
Domain: <%= check.domain %>
Kind: <%= check.kind %>
-
Date de création: <%= check.domain_created_at.to_date %>
+
Created date: <%= l(check.domain_created_at.to_date) if check.domain_created_at.present? %>
+
Update date: <%= l(check.domain_updated_at.to_date) if check.domain_updated_at.present? %>
+
Expire date: <%= l(check.domain_expire_at.to_date) if check.domain_expire_at.present? %>
<% if check.comment? %>
Comment: <%= check.comment %>
diff --git a/app/views/checks/edit.html.erb b/app/views/checks/edit.html.erb index 694395b..86ae5d1 100644 --- a/app/views/checks/edit.html.erb +++ b/app/views/checks/edit.html.erb @@ -8,7 +8,7 @@
-
+
<%= button_to("Delete", check_path(@check), class: "btn btn-danger", method: :delete, data: { confirm: "Are you sure ?" }) %>