Rails tips - SumitBisht/checklist_and_guides GitHub Wiki

adding a environment

adding a staging environment

  1. copy the contents of environments/production.rb to environments/staging.rb
  2. uncomment config.log_level = debug
  3. check the database.yml file and add the corresponding staging database configuration

the you can start the server in staging with

rails s -e staging

or the console

rails c staging

or any command with

RAILS_ENV=staging <command>

bundler and a extra environment

in your gemfile you can add

group :staging do
 gem ...
end

or

group :<any-name> do
 gem ...
end

and then assign the <any-name> group to your staging environment in application.rb

Create Rails Apps without Test::Unit

Note that this will not only skip the test directory, but also won’t create any new test files when you use the built-in controller & model generators.

rails new app -T

tip source

Console sandbox

for use the rails console, create or modify records but at the end of execution of the console, those db changes will be undone

rails c --sandbox

tip source

Task lists using Rake notes

rake notes
rake notes:todo
rake notes:custom ANNOTATION=REMEMBER

tip source

⚠️ **GitHub.com Fallback** ⚠️