开发者

What variable should I pass here?

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|  %>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜