Sha256: 36ca37764b70c67ba2f22d02d5a9a127cfd3836d0534eae8be5ecb3e0ebc4c8f

Contents?: true

Size: 493 Bytes

Versions: 3

Compression:

Stored size: 493 Bytes

Contents

module Adminpanel
  class <%= capitalized_resource %> < ActiveRecord::Base
    include Adminpanel::Base

    <%= associations if has_associations? -%>
    <%= get_gallery if has_gallery? -%>

    def self.form_attributes
      [
<%= indent(get_attribute_hash, 8) + ',' %>
<%= indent(file_field_form_hash, 8) if has_gallery? %>
      ]
    end

    def self.display_name
      '<%= capitalized_resource %>' #singular
    end

    # def self.icon
    #   "truck" # fa-{icon}
    # end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
adminpanel-2.2.2 lib/generators/adminpanel/resource/templates/adminpanel_resource_template.rb
adminpanel-2.2.1 lib/generators/adminpanel/resource/templates/adminpanel_resource_template.rb
adminpanel-2.2.0 lib/generators/adminpanel/resource/templates/adminpanel_resource_template.rb