![]() Rake log:clear # Truncates all *.log files in log/ to zero bytes (specify which logs with LOGS=test,development) Rake db:create # Create the database from config/database.yml for the current Rails.env Rake assets:precompile # Compile all the assets named in Rake assets:clean # Remove compiled assets ![]() Rake about # List versions of all Rails frameworks and the environment ![]() We'll talk more about Rake in-depth in a little while. Which database? The sqlite3 database that Rails will create for you when we run the rake db:migrate command. The migration requires that we migrate, that is, run some Ruby code (living in that 20120528060026_create_high_scores.rb) to modify the schema of our database. The generator checks that there exist the directories for models, controllers, helpers, layouts, functional and unit tests, stylesheets, creates the views, controller, model and database migration for HighScore (creating the high_scores table and fields), takes care of the route for the resource, and new tests for everything. $ rails generate scaffold HighScore game:string score:integerĬreate db/migrate/20120528060026_create_high_scores.rbĬreate app/controllers/high_scores_controller.rbĬreate app/views/high_scores/Ĭreate app/views/high_scores/Ĭreate app/views/high_scores/Ĭreate app/views/high_scores/Ĭreate app/views/high_scores/_Ĭreate test/controllers/high_scores_controller_test.rbĬreate test/helpers/high_scores_helper_test.rbĬreate app/assets/javascripts/high_scores.js.coffeeĬreate app/assets/stylesheets/high_Ĭreate app/assets/stylesheets/ Start Here Getting Started with Rails Models Active Record Basics Rails Database Migrations Active Record Validations Active Record Callbacks Active Record Associations Active Record Query Interface Views Layouts and Rendering in Rails Action View Form Helpers Controllers Action Controller Overview Rails Routing from the Outside In Digging Deeper Active Support Core Extensions Rails Internationalization API Action Mailer Basics Securing Rails Applications Debugging Rails Applications Configuring Rails Applications Rails Command Line Tools and Rake Tasks Asset Pipeline Working with JavaScript in Rails Extending Rails Rails on Rack Creating and Customizing Rails Generators Contributing to Ruby on Rails Contributing to Ruby on Rails API Documentation Guidelines Ruby on Rails Guides Guidelines Maintenance Policy Maintenance Policy Release Notes Upgrading Ruby on Rails Ruby on Rails 4.0 Release Notes Ruby on Rails 3.2 Release Notes Ruby on Rails 3.1 Release Notes Ruby on Rails 3.0 Release Notes Ruby on Rails 2.3 Release Notes Ruby on Rails 2.2 Release Notes
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |