Sha256: 59e53b1c43c596b57b6006d28d0000456ca779999bef5902dedaaeb49854e25d
Contents?: true
Size: 1.12 KB
Versions: 1
Compression:
Stored size: 1.12 KB
Contents
module Locomotive module Api class ContentEntriesController < BaseController before_filter :set_content_type def index @content_entries = @content_type.list_or_group_entries respond_with @content_entries end def create @content_entry = @content_type.entries.create(params[:content_entry]) respond_with @content_entry, :location => main_app.locomotive_api_content_entries_url(@content_type.slug) end def update @content_entry = @content_type.entries.find(params[:id]) @content_entry.update_attributes(params[:content_entry]) respond_with @content_entry, :location => main_app.locomotive_api_content_entries_url(@content_type.slug) end def destroy @content_entry = @content_type.entries.find(params[:id]) @content_entry.destroy respond_with @content_entry, :location => main_app.locomotive_api_content_entries_url(@content_type.slug) end protected def set_content_type @content_type ||= current_site.content_types.where(:slug => params[:slug]).first end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
locomotive_cms-2.0.0.rc1 | app/controllers/locomotive/api/content_entries_controller.rb |