Fix url encode and rescue publish_date in _profile.html.erb

This commit is contained in:
manson 2014-07-15 15:47:05 +08:00
parent 8c4c54dcc0
commit ecf3e35d1e
2 changed files with 4 additions and 4 deletions

View File

@ -17,7 +17,7 @@ class Admin::ResearchsController < OrbitMemberController
@member = MemberProfile.find(research_params['member_profile_id']) rescue nil @member = MemberProfile.find(research_params['member_profile_id']) rescue nil
@research = Research.new(research_params) @research = Research.new(research_params)
@research.save @research.save
redirect_to '/admin/members/'+@member.to_param+'/Research' redirect_to URI.encode('/admin/members/'+@member.to_param+'/Research')
end end
def edit def edit
@ -30,7 +30,7 @@ class Admin::ResearchsController < OrbitMemberController
@research = Research.find(params[:id]) @research = Research.find(params[:id])
@research.update_attributes(research_params) @research.update_attributes(research_params)
@research.save @research.save
redirect_to '/admin/members/'+@member.to_param+'/Research' redirect_to URI.encode('/admin/members/'+@member.to_param+'/Research')
end end
def destroy def destroy
@ -66,7 +66,7 @@ class Admin::ResearchsController < OrbitMemberController
@intro = @intro.nil? ? ResearchIntro.new({:member_profile_id=>@member.id}) : @intro @intro = @intro.nil? ? ResearchIntro.new({:member_profile_id=>@member.id}) : @intro
@intro.update_attributes(intro_params) @intro.update_attributes(intro_params)
@intro.save @intro.save
redirect_to '/admin/members/'+@member.to_param+'/Research' redirect_to URI.encode('/admin/members/'+@member.to_param+'/Research')
end end
def get_settings def get_settings

View File

@ -43,7 +43,7 @@
</td> </td>
<% end %> <% end %>
<td><%= research.year %></td> <td><%= research.year %></td>
<td><%= research.publish_date.strftime("%Y.%m") %></td> <td><%= research.publish_date.strftime("%Y.%m") rescue "" %></td>
<td> <td>
<%= link_to research.research_title, OrbitHelper.url_to_plugin_show(research.to_param,'personal_research'), target: "blank"%> <%= link_to research.research_title, OrbitHelper.url_to_plugin_show(research.to_param,'personal_research'), target: "blank"%>
<div class="quick-edit"> <div class="quick-edit">