Adminpanel

View the Project on GitHub codn/adminpanel

Special Behavior

Modules

Generators

Generator · Resource

To create an adminpanel resource run the adminpanel:resource command:

rails g adminpanel:resource guitar description:wysiwyg price:float category:belongs_to release_date:datepicker

It’s designed to work as a rails g scaffold RESOURCE for adminpanel with some enhancements, the list of permitted attributes types is:

field # no value given defaults to string
field:string
field:wysiwyg
field:float
field:integer
field:boolean
field:datepicker
field:image
field:file # when a resource have a single attachment.
category:has_many # when the resource you're creating has_many (through) Adminpanel::Category
category:belongs_to # when the resource you're creating belongs_to Adminpanel::Category

Note: Every resource needs an instance method called name.

def name return ‘’ # you can generate the name from other attributes too. end