Class: Adminpanel::Generators::GalleryGenerator
- Inherits:
-
ActiveRecord::Generators::Base
- Object
- ActiveRecord::Generators::Base
- Adminpanel::Generators::GalleryGenerator
- Defined in:
- lib/generators/adminpanel/gallery/gallery_generator.rb
Instance Method Summary collapse
- #create_migration ⇒ Object
-
#create_model ⇒ Object
argument :reference_model, :aliases => "-m", :type => :string, :require => true, :desc => 'Choose the model that you want the uploader to belong_to'.
- #create_uploader ⇒ Object
Instance Method Details
#create_migration ⇒ Object
22 23 24 25 |
# File 'lib/generators/adminpanel/gallery/gallery_generator.rb', line 22 def create_migration migration_template 'gallery_migration.rb', "db/migrate/create_adminpanel_#{lower_name.pluralize}_table.rb" puts "don't forget to add the form_field, the relationship and #{lower_name}s_attributes it to attr_accessible" end |
#create_model ⇒ Object
argument :reference_model, :aliases => "-m", :type => :string, :require => true, :desc => 'Choose the model that you want the uploader to belong_to'
14 15 16 |
# File 'lib/generators/adminpanel/gallery/gallery_generator.rb', line 14 def create_model template 'gallery_template.rb', "app/models/adminpanel/#{lower_name}.rb" end |
#create_uploader ⇒ Object
18 19 20 |
# File 'lib/generators/adminpanel/gallery/gallery_generator.rb', line 18 def create_uploader template 'uploader.rb', "app/uploader/adminpanel/#{lower_name}_uploader.rb" end |