Skip to content

Instantly share code, notes, and snippets.

@blocknotes
Last active October 23, 2017 17:37
Show Gist options
  • Select an option

  • Save blocknotes/72b82b9744846fe3afbdebb5b1182a60 to your computer and use it in GitHub Desktop.

Select an option

Save blocknotes/72b82b9744846fe3afbdebb5b1182a60 to your computer and use it in GitHub Desktop.
Ruby on Rails - Random stuff
  • Load rails app from irb: require_relative 'config/environment.rb' (after that Rails.application is available)
  • Translation key for a model (ex. MyModel): MyModel.model_name.i18n_key
  • Clean and recompile assets: rake assets:clean assets:clobber assets:precompile (preperate RAILS_ENV=production to set env)
  • Enable/disable cache in development: rake dev:cache
  • Dev routes: /rails/info/properties - /rails/info/routes
  • Search for notes comments ([TODO], [FIXME], etc.): rake notes
  • Dump/restore DB structure: rake db:structure:dump - rake db:structure:load
  • Funny method: ActionDispatch::IntegrationTest.i_suck_and_my_tests_are_order_dependent!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment