3 ms·
Doing open source, you learn little nuggets like this. I learned about `Array()` when checking out how Rails routing allowed you to pass a symbol or an array, l
by glitchdout 13y ago
Doing open source, you learn little nuggets like this. I learned about `Array()` when checking out how Rails routing allowed you to pass a symbol or an array, like:
resources :photos, only: [:index, :show]
resources :photos, only: :show
For those interested, this is the relevant code: https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/routing/mapper.rb#L979 https://github.com/rails/rails/blob/master/actionpack/lib/ac...