sort and date fixed

This commit is contained in:
Harry Bomrah 2015-12-02 18:34:48 +08:00
parent d5dac83390
commit 8b914c7eea
2 changed files with 3 additions and 1 deletions

View File

@ -48,6 +48,8 @@ class JournalPaper
before_validation :add_http
# validates :paper_title, presence: true
scope :sort_for_frontend, ->{ where(:is_hidden=>false).order_by(:year => "desc", :publication_date => "desc") }
def create_link
title = []

View File

@ -248,7 +248,7 @@
<div class="control-group">
<label class="control-label muted"><%= t("personal_journal.publication_date") %></label>
<div class="controls">
<%= 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 => @journal_paper.publication_date, :new_record => @journal_paper.new_record? %>
</div>
</div>