Skip to content
This repository has been archived by the owner on Jun 21, 2018. It is now read-only.

Problem with nested form fields #1

Closed
kamk opened this issue Jul 16, 2009 · 2 comments
Closed

Problem with nested form fields #1

kamk opened this issue Jul 16, 2009 · 2 comments

Comments

@kamk
Copy link

kamk commented Jul 16, 2009

To reproduce:

<% form_for :user do |user_form|
      user_form.fields_for :user_dates do |dates_form| %>
  <%= dates_form.calendar_date_select :first_date %>
<% end %>
@kamk
Copy link
Author

kamk commented Jul 16, 2009

Just forgot one more closing <% end %> but it gives me error '@user[user_dates]' is not allowed as an instance variable name

@jnimety
Copy link

jnimety commented Oct 14, 2009

just ran into the same issue after changing a relationship from has_many to has_one, I had

<% f.fields_for :scheduled_jobs do |sj_form| %>
  <%= sj_form.calendar_date_select :start_date %>
<% end %>

Turns out I forgot to update the fields_for, :scheduled_jobs should have been :scheduled_job. This resolved the issue for me.

This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants