Sha256: 82d316ce24369f33179757caaba70ccf986a7ef65942031bc15c9d686d4546a5

Contents?: true

Size: 598 Bytes

Versions: 6

Compression:

Stored size: 598 Bytes

Contents

module Locomotive
  module Api
    class SnippetsController < BaseController

      def index
        @snippets = current_site.snippets.all
        respond_with(@snippets)
      end

      def create
        @snippet = current_site.snippets.create(params[:snippet])
        respond_with @snippet, :location => main_app.locomotive_api_snippets_url
      end

      def update
        @snippet = current_site.snippets.find(params[:id])
        @snippet.update_attributes(params[:snippet])
        respond_with @snippet, :location => main_app.locomotive_api_snippets_url
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
locomotive_cms-2.0.0.rc7 app/controllers/locomotive/api/snippets_controller.rb
locomotive_cms-2.0.0.rc6 app/controllers/locomotive/api/snippets_controller.rb
locomotive_cms-2.0.0.rc5 app/controllers/locomotive/api/snippets_controller.rb
locomotive_cms-2.0.0.rc4 app/controllers/locomotive/api/snippets_controller.rb
locomotive_cms-2.0.0.rc2 app/controllers/locomotive/api/snippets_controller.rb
locomotive_cms-2.0.0.rc1 app/controllers/locomotive/api/snippets_controller.rb