Rails 3: Difference between revisions

From Wiki
Jump to navigation Jump to search
Created page with '== Application Setup == * create project with <pre> rails new my_project </pre> * add gem dependencies to <code>Gemfile</code> at the root level * update <code>config/application…'
 
No edit summary
Line 5: Line 5:
</pre>
</pre>
* add gem dependencies to <code>Gemfile</code> at the root level
* add gem dependencies to <code>Gemfile</code> at the root level
* update <code>config/application.rb</code> to load needed dependencies
* update <code>config/application.rb</code> to load needed dependencies and update defaults
* double-check <code>/config/initializers</code> and <code>/config/environments</code>
 
Files in <code>lib/</code> are not automatically loaded, so you need to <code>require</code> them.
 
In <code>config/environments/development.rb</code>, set
<pre>
config.action_mailer.perform_deliveries = false
</pre>
No delivery attempt is performed, but you can still see the mail in the log file to check it looks good
 
 
== Other rails commands ==
<pre>
rails console
rails server
rails runner
</pre>

Revision as of 18:43, 16 February 2011

Application Setup

  • create project with
rails new my_project
  • add gem dependencies to Gemfile at the root level
  • update config/application.rb to load needed dependencies and update defaults
  • double-check /config/initializers and /config/environments

Files in lib/ are not automatically loaded, so you need to require them.

In config/environments/development.rb, set

config.action_mailer.perform_deliveries = false

No delivery attempt is performed, but you can still see the mail in the log file to check it looks good


Other rails commands

rails console
rails server
rails runner