From 363ef493bd9bccad44d766df1e47c34d87d957cf Mon Sep 17 00:00:00 2001 From: manson Date: Tue, 15 Jul 2014 17:20:00 +0800 Subject: [PATCH] Fix url encode and rescue in _profile.html.erb --- app/controllers/admin/patents_controller.rb | 6 +++--- app/views/plugin/personal_patent/_profile.html.erb | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/admin/patents_controller.rb b/app/controllers/admin/patents_controller.rb index 12e6109..9670885 100644 --- a/app/controllers/admin/patents_controller.rb +++ b/app/controllers/admin/patents_controller.rb @@ -17,7 +17,7 @@ class Admin::PatentsController < OrbitMemberController @member = MemberProfile.find(patent_params['member_profile_id']) rescue nil @patent = Patent.new(patent_params) @patent.save - redirect_to '/admin/members/'+@member.to_param+'/Patent' + redirect_to URI.encode('/admin/members/'+@member.to_param+'/Patent') end def edit @@ -30,7 +30,7 @@ class Admin::PatentsController < OrbitMemberController @patent = Patent.find(params[:id]) @patent.update_attributes(patent_params) @patent.save - redirect_to '/admin/members/'+@member.to_param+'/Patent' + redirect_to URI.encode('/admin/members/'+@member.to_param+'/Patent') end def destroy @@ -66,7 +66,7 @@ class Admin::PatentsController < OrbitMemberController @intro = @intro.nil? ? PatentIntro.new({:member_profile_id=>@member.id}) : @intro @intro.update_attributes(intro_params) @intro.save - redirect_to '/admin/members/'+@member.to_param+'/Patent' + redirect_to URI.encode('/admin/members/'+@member.to_param+'/Patent') end def get_settings diff --git a/app/views/plugin/personal_patent/_profile.html.erb b/app/views/plugin/personal_patent/_profile.html.erb index be72b63..d6ba3d7 100644 --- a/app/views/plugin/personal_patent/_profile.html.erb +++ b/app/views/plugin/personal_patent/_profile.html.erb @@ -44,7 +44,7 @@ <%= check_box_tag 'to_change[]', patent.id.to_s, false, :class => "list-check" %> <% end %> - <%= patent.publish_date.strftime("%Y.%m") %> + <%= (patent.publish_date.strftime("%Y.%m") rescue "") %> <%= link_to patent.patent_title, OrbitHelper.url_to_plugin_show(patent.to_param,'personal_patent').to_s, target: "blank"%>