Fix page update issue, frontend faild to load widget after changing module
This commit is contained in:
parent
f53d0e9c7f
commit
9648568317
|
@ -36,6 +36,26 @@ class Admin::PagesController < Admin::ItemsController
|
|||
@item.page_contexts.build(:create_user_id => current_user.id, :update_user_id => current_user.id )
|
||||
end
|
||||
if @item.update_attributes(params[:page])
|
||||
unless params[:page]['frontend_field'].nil?
|
||||
frontend_class = []
|
||||
frontend_field_name = []
|
||||
frontend_sat_to_link = []
|
||||
|
||||
params[:page]['frontend_field'].each do |field|
|
||||
frontend_class << field['class']
|
||||
frontend_field_name << field['field_name']
|
||||
frontend_sat_to_link << field['sat_to_link']
|
||||
end
|
||||
|
||||
@item['frontend_class'] = frontend_class
|
||||
@item['frontend_field_name'] = frontend_field_name
|
||||
@item['frontend_sat_to_link'] = frontend_sat_to_link
|
||||
end
|
||||
|
||||
@item['tag'] = params[:page]['tag'] == nil ? [] : params[:page]['tag']
|
||||
|
||||
@item.save
|
||||
|
||||
render 'admin/items/reload_items'
|
||||
else
|
||||
@error = error_messages_for(@item)
|
||||
|
|
Loading…
Reference in New Issue