[Rails] Rails 4.0 Example app - fields_for
So I have a rails 3.2.11 Example app that exhibits some simple core use cases and I am starting again under rails 4.0.0.beta1
<div>
<h2><%= f.label r %></h2>
<%= f.fields_for :interactions, s.initialized_interactions() do |builder| %>
<% role = builder.object.role %>
<%= builder.hidden_field :role_id %>
<div class="field">
<%= builder.check_box :enable %>
<%= builder.label :enable, role.name %>
</div>
<% end %>
</div>
So the above renders OK for 3.2 but under rails 4.0 'builder.object' is an array of role objects and of course it fails.
Any ideas ?
On Monday, 18 March 2013 19:32:57 UTC, jle...@socit.co.uk wrote:
Hi All,--
I have 30 years as a self employed software engineer and have been experimenting with rails for several years but !!
I would have made considerably more progress and been able to give back to the community if only there was a demo application that was released with each new rails release.
I am sure that it would take no more than 15 minutes of someone within the core team to produce an app that provides just the basic of use cases:What do you think ?
- Edit of multi-level nested attributes in a single form.
- Edit several models on the same form.
- Edit multiple records from a single model on the same form.
- Basic authentication.
- Digest authentication.
P.S. On ubuntu using rvm Ruby 2.0 and Rails 4.0.0.beta1 and Ruby Mine 5.0.2 the installation of each went without any problems. I just cannot find how to implement the simple examples listed above with Rails 4.
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/rubyonrails-talk/-/X9pnA-5-4awJ.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home