artimys
4/14/2017 - 6:39 PM

Rake Commands

Ruby on Rails Rake commands



rake routes CONTROLLER=controller_name
rake routes CONTROLLER=products         # example with a controller
rake routes CONTROLLER=account/export   # example with namespace



# migrate and rollbacks
rake db:migrate:reset
rake db:rollback STEP=2

# 
rake db:seed

# cache
# Clear all files in tmp/
rake tmp:clear
# Clear all files and directories in tmp/cache
rake tmp:cache:clear
# Clear all files in tmp/sessions
rake tmp:sessions:clear
# Clear all files in tmp/sockets
rake tmp:sockets:clear
# Rake can also clear the sessions table if you’re using one:
rake db:sessions:clear

rake assets:precompile RAILS_ENV=staging