Sha256: cdc6e98cd433462dfc4a14f755cc79de10025abb385064b671b2bcf61eb48b57

Contents?: true

Size: 966 Bytes

Versions: 15

Compression:

Stored size: 966 Bytes

Contents

class ContentsController < ApplicationController
  before_filter :find_content, :only => [ :show, :edit, :update, :destroy ]

  def index 
    @contents = Content.paginate :page => params[:page]
  end

  def show
  end

  def new
    @content = Content.new
  end

  def create
    @content = Content.new(params[:content])
    if @content.save
      flash[:notice] = 'Content was successfully created.'
      redirect_to contents_url
    else
      render :action => 'new'
    end
    logger.error "#############{@content.errors.full_messages}"
  end

  def edit
  end

  def update
    if @content.update_attributes(params[:content])
      flash[:notice] = 'Content was successfully updated.'
      redirect_to :action => 'show', :id => @content
    else
      render :action => 'edit'
    end
  end

  def destroy
    @content.destroy
    redirect_to :action => 'list'
  end

  protected

    def find_content
      @content = Content.find params[:id]
    end

end

Version data entries

15 entries across 15 versions & 4 rubygems

Version Path
cehoffman-acts_as_ferret-0.4.4 doc/demo/app/controllers/contents_controller.rb
jkraemer-acts_as_ferret-0.4.4 doc/demo/app/controllers/contents_controller.rb
acts_as_ferret-0.5.4 doc/demo/app/controllers/contents_controller.rb
acts_as_ferret-0.5.3 doc/demo/app/controllers/contents_controller.rb
watson-acts_as_ferret-0.4.8.2 doc/demo/app/controllers/contents_controller.rb
acts_as_ferret-0.5.2 doc/demo/app/controllers/contents_controller.rb
acts_as_ferret-0.4.8.2 doc/demo/app/controllers/contents_controller.rb
acts_as_ferret-0.4.8.1 doc/demo/app/controllers/contents_controller.rb
acts_as_ferret-0.5.1 doc/demo/app/controllers/contents_controller.rb
acts_as_ferret-0.5 doc/demo/app/controllers/contents_controller.rb
acts_as_ferret-0.4.8.rails3 doc/demo/app/controllers/contents_controller.rb
acts_as_ferret-0.4.8 doc/demo/app/controllers/contents_controller.rb
acts_as_ferret-0.4.7 doc/demo/app/controllers/contents_controller.rb
acts_as_ferret-0.4.6 doc/demo/app/controllers/contents_controller.rb
acts_as_ferret-0.4.4 doc/demo/app/controllers/contents_controller.rb