Sha256: a774a68acf23db15ac3f0d1019cefee5c5befc85121a38cf51127354227788ea
Contents?: true
Size: 1.24 KB
Versions: 1
Compression:
Stored size: 1.24 KB
Contents
require 'activeadmin/redactor/version' require 'activeadmin/redactor_opts' require 'activeadmin/viewport_opts' require 'activeadmin' require 'rails/engine' module Activeadmin module Redactor module ControllerActions def redactorable(options={}) member_action :redactor do @viewport_opts = ViewportOpts.new(options) @redactor_opts = RedactorOpts.new(options[:redactor]) render @viewport_opts.template, layout: @viewport_opts.layout 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 if Rails.version > "3.1" initializer "ActiveAdmin Redactor precompile hook", :group => :all do |app| app.config.assets.precompile += %w(activeadmin-redactor.js activeadmin-redactor.css) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
activeadmin-redactor-0.2.0 | lib/activeadmin/redactor.rb |