We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add_nested_fields.rb line 8 should be
:object => form_builder.object.class.reflect_on_association(field).klass.new
instead of
:object => field.to_s.classify.constantize.new
The text was updated successfully, but these errors were encountered:
Hi,
I am happy to amend but would appreciate you clarifying what issues this overcomes?
Regards, Jon
Sorry, something went wrong.
Hi, jon
for example
#Model
class User < ActiveRecord::Base
has_many :addresses
has_many :permissions, :class_name => "SystemPermission"
end
class User::Address < ActiveRecord::Base
belongs_to :user
has_many :address is automatic map to Address or ::Address or User::Address
#View
<%= add_nested_fields_for(f, :addresses, 'addresses' ) %> Undefined constant Address if use reflection, the class is User::Address
<%= add_nested_fields_for(f, :permissions, 'permissions' ) %> Undefined constant Permission if use reflection, the class is SystemPermission
enjoy, Anuwat
No branches or pull requests
add_nested_fields.rb line 8 should be
:object => form_builder.object.class.reflect_on_association(field).klass.new
instead of
:object => field.to_s.classify.constantize.new
The text was updated successfully, but these errors were encountered: