Sha256: 7b611af5ffffa61be08a824d352358b323e34ffedef6ce4e257da2f6e2721188

Contents?: true

Size: 865 Bytes

Versions: 5

Compression:

Stored size: 865 Bytes

Contents

class Admin::PagesController < ApplicationController
  before_filter :authenticate
  
  def index
    @pages = Page.order('updated_at desc')
  end

  def show
    @page = Page.find(params[:id])
  end

  def new
    @page = Page.new
  end

  def edit
    @page = Page.find(params[:id])
  end

  def create
    @page = Page.new(params[:page])

    if @page.save
      redirect_to(pages_path, :notice => 'Page was successfully created.')
    else
      render :action => "new"
    end
  end

  def update
    @page = Page.find(params[:id])

    if @page.update_attributes(params[:page])
      redirect_to(pages_path, :notice => 'Page was successfully updated.')
    else
      render :action => "edit"
    end
  end

  def destroy
    @page = Page.find(params[:id])
    @page.destroy

    redirect_to(pages_path, :notice => 'Page was successfully removed.')
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
sushifish-0.9.6 lib/generators/sushi/templates/admin_pages_controller.rb
sushifish-0.9.0 lib/generators/sushi/templates/admin_pages_controller.rb
creature-0.0.6 lib/generators/pages/templates/admin_pages_controller.rb
creature-0.0.5 lib/generators/pages/templates/admin_pages_controller.rb
creature-0.0.4 lib/generators/pages/templates/admin_pages_controller.rb