-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
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
Nested has_many duplicated partial #924
Comments
Do you have gem 'nested_form' in your Gemfile ? If so, you should remove it and use the included version instead. |
Nope, afraid not. I also did a gem list to double check and the only nested_form gem I have is this one bbenezech-nested_form (0.0.2) |
I have the same problem as @pollingj. Having associations set up as follows: class Rejection < ActiveRecord::Base
belongs_to :rejectable, :polymorphic => true
end
class Photo < ActiveRecord::Base
has_many :rejections, :as => :rejectable
accepts_nested_attributes_for :rejections
attr_accessible :rejections_attributes
end when editing photo through rails_admin and clicking 'add new' button next to rejections, two rejection nested forms show up. Additionaly 'remove' button does not work on any of them. The problem occurs for any nested association. I havn't changed default config inside rails_admin initializer. I also don't have nested_form gem in my Gemfile or anywhere in project's gem list. |
In the I switched to activeadmin, but only because the client asked for a load of additional changes that were easier to sort in activeadmin. However, I did spot that when I was running this on production the above problem didn't occur, even though it did in development. |
Somehow, it looks like the asset pipeline is messing up with you guys. |
Thanks guys for your responses! You are right bbenezech - I was not using asset pipeline the right way. I was precompiling assets on development and commiting them into repository. That was causing various problems. So I've removed public/assets and I'm doing assets precompiling only during deployment. Everything works fine now. |
sorry, meant to say....yep, that's pretty much the problem I was having as well :) |
Ok, closing then. |
I'm probably doing this wrong, so apologies if I'm being dumb.
I have a model offers which has_many images. I've setup the model like this
I also have my rails_admin initialiser setup like this
This gives me the Offer Images option with 'Add New' button, however when I press the 'Add New' button it show 2 offer_image fields, and if I press the 'Add New' button again the same thing happens. The 'Delete' button for each instance also fails. Have I missed something obvious in my config?
Thanks
John
The text was updated successfully, but these errors were encountered: