Sha256: 61b52a328550d4aefaff2cc15ccc07749c0d9b81dc904d321516ed4aed364707
Contents?: true
Size: 742 Bytes
Versions: 1
Compression:
Stored size: 742 Bytes
Contents
class Transit::PagesController < TransitController respond_to :html, :js, :json def index @pages = scope_class.descending(:post_date).page((params[:page] || 1)) respond_with(@pages) do |format| format.js{ render :partial => 'table' } format.any end end def edit @page = scope_class.find(params[:id]) respond_with(@page) end def update @page = scope_class.find(params[:id]) unless @page.update_attributes(params[:page]) flash.now[:error] = "Looks like you were missing a few fields!" render :action => :edit and return end respond_with(@post, :location => edit_polymorphic_path(@page), :success => "The page '#{@page.name}' has been updated.") end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
transit-0.0.2 | app/controllers/transit/pages_controller.rb |