Just another one of those things that I find myself needing to do from time to time. Luckily this is all pretty straight forward (thankyou Ruby on Rails!). Assuming your partial is a form in the locations folder and that the variable you’re expecting is location all that you have to do is following:
View: users/show.html.erb
'locations/form', :locals => { :location => @user.location } %>
Partial: locations/_form.html.erb
Street:
Good luck!
Leave a Reply