Formtastic nested model form fields (Rails 3)
- by elsurudo
So here's the scenario:
User:
has_one :company
accepts_nested_attributes_for :company
Controller:
@user = User.new
@user.build_company
View:
<% semantic_form_for @user, :url => register_path do |form| %>
<h2>User Information</h2>
<%= form.inputs %>
<h2>Company Information</h2>
<% form.semantic_fields_for :company do |company| %>
<%= company.inputs %>
<% end %>
<%= form.buttons %>
<% end %>
After scouring the web, this SEEMS like it should work. However, all I get are the user inputs. The "semantic_fields_for :company" block outputs nothing at all...
Am I missing something here, or is this perhaps a Rails 3 bug to do with Formtastic?