Modify edit page. Still need to handle "form" with drop down lists
This commit is contained in:
1 parent
1d214bedec
commit
27d47215e9
10 files changed
+42
-8
No files matched your search
@@ -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
|
||||
|
||||
Reference in new issue
Block a user