Sha256: c85cbcd567b9241d88ddfdf9ce701dbd12c5c3ff85dc01d6bef690523239c170
Contents?: true
Size: 675 Bytes
Versions: 6
Compression:
Stored size: 675 Bytes
Contents
class Public::PagesController < PublicController def create @current_page = Page.new params[:page] if @current_page.save flash[:notice] = "Page saved!" redirect_to :action => :index else flash[:error] = "There was a problem" end end def update if current_page.update_attributes(params[:page]) flash[:notice] = "Page updated!" redirect_to :action => :index else flash[:error] = "There was a problem" render :action => :edit end end protected helper_method :current_page def current_page @current_page ||= params[:id] ? Page.find(params[:id]) : Page.new end end
Version data entries
6 entries across 6 versions & 1 rubygems