Can 'locals' be used with 'collection' when rendering partials in Rails?
- by Gav
Everything works okay when I try to render a partial like this:
= render :partial => "/shared/enquiry/car_type", :collection => @enquiry.available_car_types
However, if I also want to pass a variable (in this case 'path', because I'm sharing this partial across two forms), the path is not available to me:
= render :partial => "/shared/enquiry/car_type", :collection => @enquiry.available_car_types, :locals => {:path => customers_enquiry_path}
I've tried moving things around, but nothing appears to work, leading me to believe one cannot use locals with collections. Any help would be appreciated.
Gav