Class: SimpleNotificationGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- SimpleNotificationGenerator
- Includes:
- Rails::Generators::Migration
- Defined in:
- lib/generators/simple_notification/simple_notification_generator.rb
Instance Method Summary collapse
- #generate_controller ⇒ Object
- #generate_migration ⇒ Object
- #generate_model ⇒ Object
- #generate_view ⇒ Object
Instance Method Details
#generate_controller ⇒ Object
17 18 19 |
# File 'lib/generators/simple_notification/simple_notification_generator.rb', line 17 def generate_controller copy_file "notifications_controller.rb", "app/controllers/notifications_controller.rb" end |
#generate_migration ⇒ Object
9 10 11 |
# File 'lib/generators/simple_notification/simple_notification_generator.rb', line 9 def generate_migration migration_template "create_notifications.rb.erb", "db/migrate/create_notifications.rb" end |
#generate_model ⇒ Object
13 14 15 |
# File 'lib/generators/simple_notification/simple_notification_generator.rb', line 13 def generate_model copy_file "notification.rb", "app/models/notification.rb" end |
#generate_view ⇒ Object
21 22 23 24 25 26 |
# File 'lib/generators/simple_notification/simple_notification_generator.rb', line 21 def generate_view empty_directory "app/views/notifications" copy_file "notifications_index.html.haml", "app/views/notifications/index.html.haml" copy_file "notifications_partial.html.haml", "app/views/notifications/_show.html.haml" copy_file "notifications_css.css.scss", "app/assets/stylesheets/notifications.css.scss" end |