Create page.
This commit is contained in:
1 parent
2522cde2f5
commit
ddc7c74436
21 files changed
+163
-83
No files matched your search
@@ -40,6 +40,8 @@ class Admin::PagePartsController < ApplicationController
|
||||
@part = PagePart.find(params[:id])
|
||||
if @part.update_attributes(params[:page_part])
|
||||
flash.now[:notice] = t('admin.update_success_content')
|
||||
@part.build_content(@site_valid_locales)
|
||||
@part.save
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to admin_page_url( @part.page )
|
||||
|
||||
@@ -31,12 +31,20 @@ class Admin::PagesController < ApplicationController
|
||||
|
||||
def create
|
||||
@item = Page.new(params[:page])
|
||||
@item.content = parse_content(@item.content, {:locale => 'create'})
|
||||
if @item.save
|
||||
flash[:notice] = t('admin.create_success_page')
|
||||
redirect_to admin_items_url( :parent_id => @item.parent_id )
|
||||
@item.create_parts
|
||||
@item.save
|
||||
flash.now[:notice] = t('admin.create_success_page')
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to admin_item_url(@item)
|
||||
}
|
||||
format.js {}
|
||||
end
|
||||
else
|
||||
render :action => "new"
|
||||
flash.now[:error] = t('admin.create_error_page')
|
||||
@i18n_variable = @item.i18n_variable
|
||||
render :action => "new"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in new issue
Block a user