-
Notifications
You must be signed in to change notification settings - Fork 77
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
Default has_many does not update association #53
Comments
It's a common mistake. Just add :user_id to the attr_accessible list. Sent from my iPhone On 22 jan. 2013, at 14:20, Denis notifications@github.com wrote:
|
Added, restarted server, reloaded page. Still does not work. Netzke keeps passing |
This is intended - a foreign key value is always passed as a value for assoc column. Can you post your final models code? Sent from my iPhone On 22 jan. 2013, at 15:22, Denis notifications@github.com wrote:
|
That was right request! Somehow I mistakenly put this So now my Page model looks like: class Page < ActiveRecord::Base
belongs_to :user
attr_accessible :name, :url, :user_id
end And it works! Thank you! Just one thing that is probably wrong: when I' working with standard Rails, and if its need to mass-assign some protected attribute, it will complain loudly, raising an exception. But Netzke does not even displays a warning. |
I agree, this should be fixed (in Basepack). Working on it right now. |
I'm almost sure it will be more feedback :) Thank you! |
I created two models without explicitly specifying associations in Netzke.
When I'm editing Page, it does update all the attributes except User. I selected User from drop-down list, but its parameter passed to netzke controller looks incorrect:
\"user__name\":1
and in resultuser_id
after updating isnil
.I've put code into repository: https://github.com/denispeplin/extjs_tut/tree/ne (uses netzke from gem in this tag, but I also tried with current netzke, same issue).
Post parameters:
Not sure it is netzke-core issue, maybe it is just component does not work properly.
The text was updated successfully, but these errors were encountered: