Sha256: 0ac41b6ed099278cea85c55fc996d57be5f67d0714c1dec84ec73575f52bdc7e
Contents?: true
Size: 896 Bytes
Versions: 5
Compression:
Stored size: 896 Bytes
Contents
module Locomotive module Api class PagesController < BaseController load_and_authorize_resource :class => Locomotive::Page def index @pages = current_site.pages.order_by([[:depth, :asc], [:position, :asc]]) respond_with(@pages) end def show @page = current_site.pages.find(params[:id]) respond_with(@page) end def create @page = current_site.pages.create(params[:page]) respond_with @page, :location => main_app.locomotive_api_pages_url end def update @page = current_site.pages.find(params[:id]) @page.update_attributes(params[:page]) respond_with @page, :location => main_app.locomotive_api_pages_url end def destroy @page = current_site.pages.find(params[:id]) @page.destroy respond_with @page end end end end
Version data entries
5 entries across 5 versions & 1 rubygems