Class: EtCms::Admin::PagesController
- Inherits:
-
EtCms::AdminController
- Object
- ActionController::Base
- EtCms::ApplicationController
- EtCms::AdminController
- EtCms::Admin::PagesController
- Defined in:
- app/controllers/et_cms/admin/pages_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/et_cms/admin/pages_controller.rb', line 17 def create @page = Page.new(params[:page]) if @page.save redirect_to(pages_url, :notice => 'Page was successfully created.') else render :action => "new" end end |
#destroy ⇒ Object
41 42 43 44 |
# File 'app/controllers/et_cms/admin/pages_controller.rb', line 41 def destroy Page.destroy(params[:id]) redirect_to(pages_url) end |
#edit ⇒ Object
13 14 15 |
# File 'app/controllers/et_cms/admin/pages_controller.rb', line 13 def edit @page = Page.find(params[:id]) end |
#index ⇒ Object
5 6 7 |
# File 'app/controllers/et_cms/admin/pages_controller.rb', line 5 def index @pages = Page.all end |
#new ⇒ Object
9 10 11 |
# File 'app/controllers/et_cms/admin/pages_controller.rb', line 9 def new @page = Page.new end |
#update ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'app/controllers/et_cms/admin/pages_controller.rb', line 27 def update @page = Page.find(params[:id]) respond_to do |format| if @page.update_attributes(params[:page]) format.html { redirect_to(pages_url, :notice => 'Page was successfully updated.') } format.json { head :ok } else format.html { render :action => "edit" } format.json { head :bad_request } end end end |