-
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
pass parameters to new forms when model is namespaced #2701
pass parameters to new forms when model is namespaced #2701
Conversation
fix model.to_param for passing params add tests
Why is this fix needed? Isn't it enough to pass |
No it didn't work, I committed a test for this case. |
@mshibuya i see the same issue. |
@loicginoux could you rebase these commits in one ? (might this is blocker for merge) |
|
||
describe 'GET /admin/cms_basic_page/new with parameters for pre-population' do | ||
it 'populates form field when corresponding parameters are passed in' do | ||
visit new_path(model_name: 'cms~basic_page', cms_basic_page: {title: 'Hello'}) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which before block do you mean ? the one in line 20 is not called in this test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh sorry, you are right.
I am having the same issues with forms.. Would be great if proposed PR would be merged |
Merged in, thanks! |
When model is namespaced, the prepopulation of the new form via params didn't work.
That should fix it.