Revert "Clean code and add 'name' in theme.rb"
This reverts commit 608180646b.
This commit is contained in:
1 parent
608180646b
commit
00813c9060
16 files changed
+177
-59
No files matched your search
@@ -21,11 +21,14 @@ class Admin::PagesController < ApplicationController
|
||||
@item = Page.new
|
||||
@item.is_published = true
|
||||
@item.parent_id = @parent_item.id rescue nil
|
||||
@designs = Design.all.entries
|
||||
@default_design = @designs.detect {|d| d.title.to_s == 'Bob' }
|
||||
end
|
||||
|
||||
def edit
|
||||
@item = Page.find(params[:id])
|
||||
# @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
|
||||
@@ -48,6 +51,19 @@ class Admin::PagesController < ApplicationController
|
||||
end
|
||||
|
||||
def update
|
||||
@item = Page.find(params[:id])
|
||||
parse_content_update_code(@item, params[:page][:content])
|
||||
if @item.update_attributes(params[:item])
|
||||
flash[:notice] = t('admin.update_success_page')
|
||||
respond_to do |format|
|
||||
format.html {
|
||||
redirect_to admin_page_url(@item)
|
||||
}
|
||||
format.js {}
|
||||
end
|
||||
else
|
||||
render :action => "edit"
|
||||
end
|
||||
end
|
||||
|
||||
def destroy
|
||||
|
||||
Reference in new issue
Block a user