Form_for instance model help; move logic from form to controller

I have this form, everything works fine, but I would like to move the
current_user.relationships.build logic to the controller.

<%= form_for(current_user.relationships.build(followed_id: @user.id)) do
|f| %>

<%= f.hidden_field :followed_id %>
<%= f.submit "Follow", class: "btn btn-large btn-primary" %><% end %>

Controller Relationships create method

def create
@user = User.find(params[:relationship][:followed_id])
current_user.follow!(@user)
redirect_to @user

end

so if in your action you do

@relationship = current_user.relationships.build(followed_id: @user.id)

you should have a variable called relationship on your view:

<%= form_for(relationship) do |f| %>

<%= f.hidden_field :followed_id %>
<%= f.submit "Follow", class: "btn btn-large btn-primary" %><% end %>