Class: DustAlbumGenerator
- Inherits:
-
ActiveRecord::Generators::Base
- Object
- ActiveRecord::Generators::Base
- DustAlbumGenerator
- Defined in:
- lib/generators/dust_album/dust_album_generator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.source_root ⇒ Object
6 7 8 |
# File 'lib/generators/dust_album/dust_album_generator.rb', line 6 def self.source_root @source_root ||= File.('../templates', __FILE__) end |
Instance Method Details
#create_migration ⇒ Object
10 11 12 13 14 15 |
# File 'lib/generators/dust_album/dust_album_generator.rb', line 10 def create_migration route("resources :albums") route("resources :photos") migration_template "albums_migration.rb", "db/migrate/create_albums.rb" migration_template "photos_migration.rb", "db/migrate/create_photos.rb" end |
#generate_static_files ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/generators/dust_album/dust_album_generator.rb', line 17 def generate_static_files copy_file "dust_album.css", "public/stylesheets/dust_album.css" copy_file "uploadify.css", "public/stylesheets/uploadify.css" copy_file "initializers/flash_session_cookie_middleware.rb", "config/initializers/flash_session_cookie_middleware.rb" copy_file "initializers/session_store_middleware.rb", "config/initializers/session_store_middleware.rb" copy_file "jquery-1.4.2.js", "public/javascripts/jquery-1.4.2.js" copy_file "images/cancel.png", "public/images/cancel.png" copy_file "images/browse.png", "public/images/browse.png" copy_file "images/upload.png", "public/images/upload.png" copy_file "dust_album.css", "public/stylesheets/dust_album.css" copy_file "uploadify.css", "public/stylesheets/uploadify.css" directory "uploadify", "public/javascripts/uploadify" end |
#rake_migrations ⇒ Object
36 37 38 |
# File 'lib/generators/dust_album/dust_album_generator.rb', line 36 def rake_migrations rake("db:migrate") end |