Sha256: 052e9ce44436a52c6f93da19d3b49c21d616f4f486ef5a0b7bd5e52f01f4f156

Contents?: true

Size: 811 Bytes

Versions: 1

Compression:

Stored size: 811 Bytes

Contents

require 'activeadmin/redactor/version'
require 'activeadmin'
require 'rails/engine'

module Activeadmin
  module Redactor
    module ControllerActions
      def redactorable
        member_action :redactor do
          render 'redactor/editor', layout: false
        end
      end
    end

    module TableMethods
      def redactorable_edit_icon
        column 'Redactor', class: 'activeadmin-redactorable' do |resource|
          resource_redactor_path = resource_path(resource)
          resource_redactor_path << '/redactor'
          link_to 'Redactor', resource_redactor_path, class: 'edit'
        end
      end
    end

    ::ActiveAdmin::ResourceDSL.send(:include, ControllerActions)
    ::ActiveAdmin::Views::TableFor.send(:include, TableMethods)

    class Engine < ::Rails::Engine
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activeadmin-redactor-0.0.1 lib/activeadmin/redactor.rb