diff --git a/app/models/writing_conference.rb b/app/models/writing_conference.rb index 8bf8b84..8d83c0e 100644 --- a/app/models/writing_conference.rb +++ b/app/models/writing_conference.rb @@ -40,6 +40,8 @@ class WritingConference before_validation :add_http + scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(:year => "desc", :publication_date => "desc") } + def create_link title = [] diff --git a/app/views/admin/writing_conferences/_form.html.erb b/app/views/admin/writing_conferences/_form.html.erb index 9b4e4ef..5525934 100644 --- a/app/views/admin/writing_conferences/_form.html.erb +++ b/app/views/admin/writing_conferences/_form.html.erb @@ -183,7 +183,7 @@
- <%= f.datetime_picker :period_start_date, :no_label => true, :format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD" %> + <%= f.datetime_picker :period_start_date, :no_label => true, :format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD", :value => @writing_conference.period_start_date, :new_record => @writing_conference.new_record? %>
@@ -191,7 +191,7 @@
- <%= f.datetime_picker :period_end_date, :no_label => true, :format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD" %> + <%= f.datetime_picker :period_end_date, :no_label => true, :format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD", :value => @writing_conference.period_end_date, :new_record => @writing_conference.new_record? %>
@@ -257,7 +257,7 @@
- <%= f.datetime_picker :publication_date, :no_label => true, :format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD" %> + <%= f.datetime_picker :publication_date, :no_label => true, :format=>"yyyy/MM/dd", :placeholder=>"YYYY/MM/DD", :value => @writing_conference.publication_date, :new_record => @writing_conference.new_record? %>