Sha256: 2265f4941d59ca10691f82236a8179bd0c50689b401ae65417a7dc90fc14135f

Contents?: true

Size: 625 Bytes

Versions: 2

Compression:

Stored size: 625 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

2 entries across 2 versions & 1 rubygems

Version Path
landable-1.14.0 app/controllers/landable/api/template_revisions_controller.rb
landable-1.13.2 app/controllers/landable/api/template_revisions_controller.rb