<%= form_for([@post, @post.bids.build]),
:url => { :action => "offer_bid" } do |f| %>
<%= f.submit "Offer Post to this user" %>
<% end %>
I'm trying to use the above form to update one particular column of bid model( bid is a model nested under post) :-
resources :posts do
resources :bids
end
I already have form for creating a new row of bid model.
Now I'm adding one more 开发者_Go百科form for the same model - bid to do some manipulations. But I'm getting the following syntax error on trying to use the above form. :-compile error
/home/saran/work_space/rails_apps/incomplete_bid_excercise/app/views
/bids/_offer_bid.html.erb:1: syntax error, unexpected tASSOC, expecting kEND
...st, @post.bids.build]),:url => { :action => "offer_bid" } do...
^
/home/saran/work_space/rails_apps/incomplete_bid_excercise/app/views
/bids/_offer_bid.html.erb:1: syntax error, unexpected kDO, expecting kEND
... { :action => "offer_bid" } do |f| @output_buffer.safe_conca...
^
/home/saran/work_space/rails_apps/incomplete_bid_excercise/app/views
/bids/_offer_bid.html.erb:7: syntax error, unexpected kENSURE, expecting $end
Thanks in advance :).
I'm using Rails 3.0.1.Your closing parenthesis on your form_for
method call was in the wrong place. This should fix it:
<%= form_for([@post, @post.bids.build], { :url => { :action => "offer_bid" } }) do |f| %>
<%= f.submit "Offer Post to this user" %>
<% end %>
精彩评论