Sha256: bd976947450635f1e5739b9c14b6b47abf251f6976f94ba4d924d0e21ebbba71
Contents?: true
Size: 778 Bytes
Versions: 1
Compression:
Stored size: 778 Bytes
Contents
class <%= class_name %>Resource < Madmin::Resource # Attributes <% model_attributes.each do |attribute_name| -%> attribute :<%= attribute_name %><%= formatted_options_for_attribute(attribute_name) %> <% end -%> # Associations <% associations.each do |association_name| -%> attribute :<%= association_name %> <% end -%> # Add scopes to easily filter records # scope :published # Add actions to the resource's show page # member_action do |record| # link_to "Do Something", some_path # end # Customize the display name of records in the admin area. # def self.display_name(record) = record.name # Customize the default sort column and direction. # def self.default_sort_column = "created_at" # # def self.default_sort_direction = "desc" end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
madmin-2.0.0 | lib/generators/madmin/resource/templates/resource.rb.tt |