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