Sha256: 5dac655201cba4f5320a6662e26e10bb6e2d96b6a415dac09b7ff5ca195ab52e

Contents?: true

Size: 652 Bytes

Versions: 15

Compression:

Stored size: 652 Bytes

Contents

module RailsAdmin
  module Config
    module Actions
      class ShowInApp < RailsAdmin::Config::Actions::Base
        RailsAdmin::Config::Actions.register(self)

        register_instance_option :member do
          true
        end

        register_instance_option :visible? do
          authorized? && (bindings[:controller].main_app.url_for(bindings[:object]) rescue false)
        end

        register_instance_option :controller do
          Proc.new do
            redirect_to main_app.url_for(@object)
          end
        end

        register_instance_option :link_icon do
          'icon-eye-open'
        end
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 2 rubygems

Version Path
rails_admin-0.4.4 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-lbgraham-0.4.2 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-0.4.3 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-0.4.2 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-0.4.1 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-0.4.0 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-0.3.0 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-0.2.0 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-0.1.2 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-0.1.1 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-0.1.0 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-0.0.5 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-0.0.4 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-0.0.3 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-0.0.2 lib/rails_admin/config/actions/show_in_app.rb