Sha256: 6c6b38c6bcf2d2e1315485162d85ab0fee02a1daeb534827a74b5a6cc54a589c

Contents?: true

Size: 626 Bytes

Versions: 15

Compression:

Stored size: 626 Bytes

Contents

require_dependency "landable/api_controller"

module Landable
  module Api
    class TemplateRevisionsController < ApiController

      def index
        template = Template.find(params[:template_id])
        respond_with template.revisions.order(:ordinal).reverse
      end

      def show
        revision = TemplateRevision.find(params[:id])

        respond_to do |format|
          format.json { respond_with revision }
        end
      end

      def revert_to
        revision = TemplateRevision.find(params[:id])
        revision.template.revert_to! revision
        respond_with revision
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
landable-1.13.1 app/controllers/landable/api/template_revisions_controller.rb
landable-1.12.3 app/controllers/landable/api/template_revisions_controller.rb
landable-1.12.2 app/controllers/landable/api/template_revisions_controller.rb
landable-1.12.1 app/controllers/landable/api/template_revisions_controller.rb
landable-1.11.1 app/controllers/landable/api/template_revisions_controller.rb
landable-1.11.0 app/controllers/landable/api/template_revisions_controller.rb
landable-1.10.0.rc2 app/controllers/landable/api/template_revisions_controller.rb
landable-1.10.0.rc1 app/controllers/landable/api/template_revisions_controller.rb
landable-1.9.2 app/controllers/landable/api/template_revisions_controller.rb
landable-1.9.1 app/controllers/landable/api/template_revisions_controller.rb
landable-1.9.0 app/controllers/landable/api/template_revisions_controller.rb
landable-1.9.0.rc2 app/controllers/landable/api/template_revisions_controller.rb
landable-1.9.0.rc1 app/controllers/landable/api/template_revisions_controller.rb
landable-1.8.0 app/controllers/landable/api/template_revisions_controller.rb
landable-1.7.1.rc1 app/controllers/landable/api/template_revisions_controller.rb