Class: FiatPublication::PagesController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- FiatPublication::PagesController
- Defined in:
- app/controllers/fiat_publication/pages_controller.rb
Instance Method Summary collapse
- #create ⇒ Object
- #destroy ⇒ Object
- #edit ⇒ Object
- #index ⇒ Object
- #new ⇒ Object
- #preview ⇒ Object
- #update ⇒ Object
Instance Method Details
#create ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'app/controllers/fiat_publication/pages_controller.rb', line 15 def create @page = Current.publisher.pages.create(page_params) respond_to do |format| if @page.save format.html { redirect_to edit_account_page_path(@page), notice: 'Page successfully saved.' } else format.html { render action: "new" } end end end |
#destroy ⇒ Object
44 45 46 47 48 49 50 |
# File 'app/controllers/fiat_publication/pages_controller.rb', line 44 def destroy @page.destroy respond_to do |format| format.html { redirect_to account_publisher_pages_path(@page.publisher), notice: 'Page was successfully deleted.' } end end |
#edit ⇒ Object
27 28 |
# File 'app/controllers/fiat_publication/pages_controller.rb', line 27 def edit end |
#index ⇒ Object
6 7 8 9 |
# File 'app/controllers/fiat_publication/pages_controller.rb', line 6 def index # @pages = Current.publisher.pages.order("title ASC").all @pages = Page.all end |
#new ⇒ Object
11 12 13 |
# File 'app/controllers/fiat_publication/pages_controller.rb', line 11 def new @page = Page.new end |
#preview ⇒ Object
40 41 42 |
# File 'app/controllers/fiat_publication/pages_controller.rb', line 40 def preview @page = Page.find(params[:id]) end |
#update ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'app/controllers/fiat_publication/pages_controller.rb', line 30 def update respond_to do |format| if @page.update_attributes(page_params) format.html { redirect_back(fallback_location: edit_account_page_path(@page), notice: 'Page successfully updated.') } else format.html { render action: "edit" } end end end |