fix journal paper new errors
This commit is contained in:
parent
adea371161
commit
5992be0d19
|
@ -45,8 +45,8 @@ class Admin::JournalPapersController < OrbitMemberController
|
|||
format.html { redirect_to admin_journal_papers_path }
|
||||
format.xml { render :xml => @journal_paper, :status => :created, :location => @journal_paper }
|
||||
else
|
||||
format.html { render action: "new" }
|
||||
format.xml { render :xml => @journal_paper.errors, :status => :unprocessable_entity }
|
||||
format.html { render action: 'new' }
|
||||
format.json { render json: @extension.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
@ -61,7 +61,7 @@ class Admin::JournalPapersController < OrbitMemberController
|
|||
format.xml { head :ok }
|
||||
else
|
||||
format.html { render action: "edit" }
|
||||
format.xml { render :xml => @journal_paper.errors, :status => :unprocessable_entity }
|
||||
format.json { render json: @extension.errors, status: :unprocessable_entity }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
|
@ -47,7 +47,7 @@ class JournalPaper
|
|||
title = []
|
||||
|
||||
title << self.member_profile.name if self.member_profile_id.present?
|
||||
title << (!self.journal_levels.blank? ? "#{self.journal_paper_authors.collect{|j| j.name}.join(', ')}" : nil)
|
||||
title << (!self.journal_paper_authors.blank? ? "#{self.journal_paper_authors.collect{|j| j.name}.join(', ')}" : nil)
|
||||
if !self.publication_date.nil?
|
||||
pd = self.publication_date.strftime("%Y-%m-%d").split('-')
|
||||
title << pd[0]
|
||||
|
@ -64,7 +64,7 @@ class JournalPaper
|
|||
def authors
|
||||
authors = []
|
||||
authors << self.member_profile.name if self.member_profile_id.present?
|
||||
authors << (!self.journal_levels.blank? ? "#{self.journal_paper_authors.collect{|j| j.name}.join(', ')}" : nil)
|
||||
authors << (!self.journal_paper_authors.blank? ? "#{self.journal_paper_authors.collect{|j| j.name}.join(', ')}" : nil)
|
||||
authors.join(', ')
|
||||
end
|
||||
|
||||
|
|
|
@ -13,7 +13,9 @@
|
|||
<%= javascript_include_tag "lib/datetimepicker/date.time.picker.js" %>
|
||||
<%= javascript_include_tag "lib/datetimepicker/datetimepicker" %>
|
||||
<% end %>
|
||||
|
||||
<div class="form-group has-error">
|
||||
<center><%= @journal_paper.errors.full_messages.first if @journal_paper.errors.any? %></center>
|
||||
</div>
|
||||
<!-- Input Area -->
|
||||
<div class="input-area">
|
||||
|
||||
|
|
Loading…
Reference in New Issue