-
-
Notifications
You must be signed in to change notification settings - Fork 3.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
Add support to has_many form building with draper #1774
Comments
I am working on a fix for this right now and should have a pull request once I go through all the steps in the contribution guide. |
@ready4god2513 How's this coming? I was actually thinking we should not send the decorated model to the form anyway, but I'm curious what your angle on this is... See #2013. |
@amiel given what's happened since, thoughts on this? |
@ready4god2513 Does #2085 solve this for you? Or do you still need to handle I don't have need for this myself, but I do think that using @daxter you at railsconf? |
No I'm not unfortunately. I assume you are? I'm assuming that the OP's problem is caused by this line in the has_many form builder. Where we'd need this to deal with either situation: obj = has_many_form.object
resource = obj.respond_to?(:model_class) ? obj.model_class : obj
if resource.new_record?
# ... |
I actually haven't been using active_admin for most recent projects. Sorry I couldn't be of more help. |
@daxter thoughts? Are you ok with letting this lie until it becomes an issue? |
I'm hesitant to implement this since I haven't actually used decorators before. I'd just leave it be until someone else runs into the problem. |
That sounds reasonable to me. I'll be happy to tackle it if it becomes an issue. Until then the |
When using draper to decorate, building forms with has_many fields does not work correctly as the class is not a model, but a draper wrapped object. Draper provides a method called "model_class" which will return the wrapped object class.
The text was updated successfully, but these errors were encountered: