I have a profile model and a user has_one profile. Also, the profile is a nested re开发者_开发问答source inside the user resource. I'm creating an edit.html.erb form for the profile view. What variable should I be passing to the form in this line:
<%= form_for(????) do |f| %>
By the way, this is my edit method in the profiles controller:
def edit
@user = current_user
@profile = @user.profiles.find(params[:id])
end
In your view:
<%= form_for([@user, @profile]) do |f| %>
精彩评论