RailsCasts Pro episodes are now free!

Learn more or hide this

William Limratana's Profile

GitHub User: limratana

Comments by William Limratana


I am trying to combine the information from episode 235 and this episode. I am unsure what to set the routes as. By following 235 my route is :

devise_for :users, :controllers => {:sessions => 'sessions', :registrations => 'registrations', :omniauth_callbacks => "users/omniauth_callbacks"}

Following this episode, my routes would be :

  match 'auth/:provider/callback', to: 'sessions#create'
  match 'auth/failure', to: redirect('/')
  match 'signout', to: 'sessions#destroy', as: 'signout'

If I follow 235 and try to combine it here, do I need to override the devise session controller create method?

I ultimately need to do all this via ajax.


Miniprofiler is showing many queries selecting from pg_attribute and pg_class. These queries are not in the development log. 14 of the 20 queries on one of my pages are these pg queries. Do these queries have to be run? If not how can I prevent them from running?

I reloaded my page and it seems these are not run again, so it must be some kind of 'first time the server loads' type queries.


Is it certain that "CONFIG.merge! CONFIG.fetch(Rails.env, {})" will pull in heroku environment variables pulled in via heroku config:push from the .env file?


Minor not that may help folks if you aren't familiar with yml files (I am not) :

if you want to put your AWS account, access key, and secret access key in enviornment variables, you must use the <%= %> brackets to access them. For example :

access_key: <%= ENV["AWS_ACCESS_KEY"] %>

This is unlike other rails configuration files. I'm not quite sure why since yml files look ruby-ish.