i have a form_for code
<%form_for :a,:url=>{:controller=>"biz/a",:action=>"save"},:html =>{:multipart => true} do |f| %>
.....
<%f.fields_for :b do |b|%>
.....
<%b.fields_for :apples do |apple|%>
...
<%end%>
....
<%end%>
it outputs the html code without fields_for function
<textarea cols="40" id="a_b_apples_content" name="a[b][apples][content]" rows="20" style="width:500px;height:100px;border:1px #889BAA solid;color:#999;font-size:12px;padding:6px;"></textarea>
when i change the form_for to :
<%form_for @a,:url=>{:controller=>"biz/a",:action=>"save"},:html =>{:multipart => true} do |f| %>
it just work fine. And it outputs:
<textarea cols="40" id="a_b_apples_content" name="a[b_attributes][apples_attributes][0][content]" rows="20" style="width:500px;height:100px;border:1px #889BAA solid;color:#999;font-size:12px;padding:6px;"></textarea>
as i want. why dont the symbol in form_for work fine?what's difference between :a and @a in form_for. Thanks. I use rails 2.3.8 , ruby 1.8.7,chrome web browser.