Besides a good idea or not, I would like to know how to access the locals hash from inside the partial instead of local variables with the same name?
I am trying to try to explore a potentially more efficient approach to a pattern, which I often participate in partial defaults:
:locals => { :opts => {:myvar => @myvar}}
Then inside the partial:
opts.reverse_merge!(defaults)
It would be much cleaner to write (especially when the choice becomes more numerous):
:locals => { :myvar => @myvar}
Then inside the partial:
opts => defaults.merge(local_hash)
source share