From ecf3e35d1e715ff19276435c273d7f8a71a198a1 Mon Sep 17 00:00:00 2001 From: manson Date: Tue, 15 Jul 2014 15:47:05 +0800 Subject: [PATCH] Fix url encode and rescue publish_date in _profile.html.erb --- app/controllers/admin/researchs_controller.rb | 6 +++--- app/views/plugin/personal_research/_profile.html.erb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/admin/researchs_controller.rb b/app/controllers/admin/researchs_controller.rb index d2dfd53..1e25597 100644 --- a/app/controllers/admin/researchs_controller.rb +++ b/app/controllers/admin/researchs_controller.rb @@ -17,7 +17,7 @@ class Admin::ResearchsController < OrbitMemberController @member = MemberProfile.find(research_params['member_profile_id']) rescue nil @research = Research.new(research_params) @research.save - redirect_to '/admin/members/'+@member.to_param+'/Research' + redirect_to URI.encode('/admin/members/'+@member.to_param+'/Research') end def edit @@ -30,7 +30,7 @@ class Admin::ResearchsController < OrbitMemberController @research = Research.find(params[:id]) @research.update_attributes(research_params) @research.save - redirect_to '/admin/members/'+@member.to_param+'/Research' + redirect_to URI.encode('/admin/members/'+@member.to_param+'/Research') end def destroy @@ -66,7 +66,7 @@ class Admin::ResearchsController < OrbitMemberController @intro = @intro.nil? ? ResearchIntro.new({:member_profile_id=>@member.id}) : @intro @intro.update_attributes(intro_params) @intro.save - redirect_to '/admin/members/'+@member.to_param+'/Research' + redirect_to URI.encode('/admin/members/'+@member.to_param+'/Research') end def get_settings diff --git a/app/views/plugin/personal_research/_profile.html.erb b/app/views/plugin/personal_research/_profile.html.erb index 08f23d7..0d66542 100644 --- a/app/views/plugin/personal_research/_profile.html.erb +++ b/app/views/plugin/personal_research/_profile.html.erb @@ -43,7 +43,7 @@ <% end %> <%= research.year %> - <%= research.publish_date.strftime("%Y.%m") %> + <%= research.publish_date.strftime("%Y.%m") rescue "" %> <%= link_to research.research_title, OrbitHelper.url_to_plugin_show(research.to_param,'personal_research'), target: "blank"%>