Reputation: 601
I'm trying to pass some locals into a partial render in rails, however they are not getting passed.
<%=render :partial => "search_results", :locals => {:refinement => "all", :query => params[:search]}%>
The partial is being rendered in a view that has the param[:search]
in it, that params[:search]
is accessable inside of the partial without it being passed in as a local.
I'm trying to access the locals refinement and query by doing params[:refinement]
and params[:query]
inside of the partial, however they are not being recognized.
Upvotes: 0
Views: 184
Reputation: 1798
Access them as locals[:refinement]
or locals[:query]
inside your partial. That should work.
Upvotes: 0
Reputation: 25049
You don't access them via params
- you just access the local variable, eg. refinement
or query
.
Upvotes: 2