From ff30b3d05e78e9a4a0380dfd4761ed380576cf07 Mon Sep 17 00:00:00 2001 From: chris Date: Tue, 19 Mar 2013 18:23:35 +0800 Subject: [PATCH] Fix link not showing for default front end --- app/controllers/admin/pages_controller.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index b89981f1..28b51ca4 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -93,8 +93,10 @@ helper Admin::PagePartsHelper @item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id ) end - params[:page][:frontend_field] = params[:page][:frontend_field].zip( params[:page][:frontend_field_type] ) if params[:page][:frontend_field] + params[:page][:frontend_field] = params[:page][:frontend_field].zip( params[:page][:frontend_field_type], params[:page][:frontend_field_is_link] ) if params[:page][:frontend_field] + params[:page][:frontend_field_type] = nil + params[:page][:frontend_field_is_link] = nil if params[:page][:tag] && params[:page][:tag].include?("nil") params[:page][:tag] = [] @@ -104,6 +106,9 @@ helper Admin::PagePartsHelper params[:page][:category] = [] end + params[:page][:frontend_field].each{|t| t[2] = (t[2]=="true" ? true : false )} if !params[:page][:frontend_field].blank? + + if @item.update_attributes(params[:page]) flash[:notice] = t('update.success.page') respond_to do |format|