Sha256: c8afdb267ea6ae1da35b625a0f7b89f4df8c221852e9e03a0d29c7c41ad67608
Contents?: true
Size: 686 Bytes
Versions: 30
Compression:
Stored size: 686 Bytes
Contents
puts "Export Concern from ThecoreUiRailsAdmin" require 'active_support/concern' module ExportConcern extend ActiveSupport::Concern included do # Should the action be visible # Edit By taris, it shows the button only if there are records displayed register_instance_option :visible? do # If not in index, then return true, # otherwise it wont' be added to the list # of all Actions during rails initialization # In index, instead, I show it only if there are records in the current view bindings[:controller].action_name == "index" ? (authorized? && !bindings[:controller].instance_variable_get("@objects").blank?) : true end end end
Version data entries
30 entries across 30 versions & 1 rubygems