Archived
HTML code can be modify (paser: update)
This commit is contained in:
1 parent
dda4b30d67
commit
247b8ec4dc
12 files changed
+127
-13
No files matched your search
@@ -25,8 +25,10 @@ class Admin::PagesController < ApplicationController
|
||||
|
||||
def edit
|
||||
@item = Page.find(params[:id])
|
||||
@item.content = parse_content(@item.content, {:locale => 'show'})
|
||||
# @item.content = parse_content(@item.content, {:locale => 'show'})
|
||||
@item.content = parse_page_code(@item)
|
||||
@i18n_variable = @item.i18n_variable
|
||||
@code = params[:code]
|
||||
end
|
||||
|
||||
def create
|
||||
@@ -39,7 +41,7 @@ class Admin::PagesController < ApplicationController
|
||||
format.html {
|
||||
redirect_to admin_page_url(@item)
|
||||
}
|
||||
format.js {}
|
||||
format.js {}
|
||||
end
|
||||
else
|
||||
flash.now[:error] = t('admin.create_error_page')
|
||||
@@ -50,12 +52,15 @@ class Admin::PagesController < ApplicationController
|
||||
|
||||
def update
|
||||
@item = Page.find(params[:id])
|
||||
parse_content(@item.content, {:locale => 'destroy'})
|
||||
if @item.update_attributes(params[:page])
|
||||
@item.content = parse_content(@item.content, {:locale => 'create'})
|
||||
@item.save!
|
||||
parse_content_update_code(@item, params[:page][:content])
|
||||
if @item.update_attributes(params[:item])
|
||||
flash[:notice] = t('admin.update_success_page')
|
||||
redirect_to admin_items_url( :parent_id => @item.parent_id )
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to admin_page_url(@item)
|
||||
}
|
||||
format.js {}
|
||||
end
|
||||
else
|
||||
render :action => "edit"
|
||||
end
|
||||
|
||||
Reference in new issue
Block a user