Issue
In my Rails 3 project I have:
namespace :admin do
resources :users
end
scope :frontend do
resources :users
end
There is a partial with filename "/views/admin/users/_form_fields.html.haml".
And I want to render it from "/views/frontend/users/_form.html.haml".
This code doesn't work:
render 'admin/users/form_fields', :f => f
Solution
To pass local variables you need this sintax:
render :partial => "/admin/users/form_fields", :locals => { :f => f }
Hope this helps. you can take a look to Rails Guide: Using Partials
Answered By - JCorcuera Answer Checked By - Clifford M. (PHPFixing Volunteer)
0 Comments:
Post a Comment
Note: Only a member of this blog may post a comment.