diff --git a/app/controllers/admin/pages_controller.rb b/app/controllers/admin/pages_controller.rb index a0f4231e..1fcc7bde 100644 --- a/app/controllers/admin/pages_controller.rb +++ b/app/controllers/admin/pages_controller.rb @@ -26,6 +26,11 @@ class Admin::PagesController < ApplicationController end def edit + @item = Page.find(params[:id]) + @i18n_variable = @item.i18n_variable + @designs = Design.all.entries + @design = @item.design + @default_design = @design.themes.detect {|t| t.id == @item.theme_id } end def create @@ -48,6 +53,18 @@ class Admin::PagesController < ApplicationController end def update + @item = Page.find(params[:id]) + 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 diff --git a/app/helpers/admin/item_helper.rb b/app/helpers/admin/item_helper.rb index e91265fc..c28c9b8f 100644 --- a/app/helpers/admin/item_helper.rb +++ b/app/helpers/admin/item_helper.rb @@ -12,6 +12,7 @@ module Admin::ItemHelper ret << "