Rails tips - SumitBisht/checklist_and_guides GitHub Wiki
adding a staging environment
- copy the contents of
environments/production.rb
toenvironments/staging.rb
- uncomment
config.log_level = debug
- 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>
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
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
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
rake notes
rake notes:todo
rake notes:custom ANNOTATION=REMEMBER