Sha256: b7cfbfa57f63ae21bf19d6775987eb6e91233b9b914364555ec2573d50f3ddd3

Contents?: true

Size: 815 Bytes

Versions: 12

Compression:

Stored size: 815 Bytes

Contents

# frozen_string_literal: true

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? && begin
            bindings[:controller].main_app.url_for(bindings[:object])
          rescue StandardError
            false
          end
        end

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

        register_instance_option :link_icon do
          'fas fa-eye'
        end

        register_instance_option :turbo? do
          false
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
rails_admin-3.2.1 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-3.2.0 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-3.2.0.rc lib/rails_admin/config/actions/show_in_app.rb
rails_admin-3.2.0.beta lib/rails_admin/config/actions/show_in_app.rb
rails_admin-3.1.4 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-3.1.3 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-3.1.2 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-3.1.1 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-3.1.0 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-3.1.0.rc2 lib/rails_admin/config/actions/show_in_app.rb
rails_admin-3.1.0.rc lib/rails_admin/config/actions/show_in_app.rb
rails_admin-3.1.0.beta lib/rails_admin/config/actions/show_in_app.rb