Skip to content

pass parameters to new forms when model is namespaced#2701

Merged
mshibuya merged 2 commits into
railsadminteam:masterfrom
loicginoux:pass_params_to_new
Feb 13, 2017
Merged

pass parameters to new forms when model is namespaced#2701
mshibuya merged 2 commits into
railsadminteam:masterfrom
loicginoux:pass_params_to_new

Conversation

@loicginoux

Copy link
Copy Markdown
Contributor

When model is namespaced, the prepopulation of the new form via params didn't work.
That should fix it.

fix model.to_param for passing params

add tests
@loicginoux loicginoux changed the title pass parameters to new forms when model is namepsaced pass parameters to new forms when model is namespaced Aug 25, 2016
@mshibuya

mshibuya commented Oct 8, 2016

Copy link
Copy Markdown
Member

Why is this fix needed? Isn't it enough to pass 'cms~basic_page' => {title: 'Hello'}?

@loicginoux

Copy link
Copy Markdown
Contributor Author

No it didn't work, I committed a test for this case.

@lazebny

lazebny commented Feb 11, 2017

Copy link
Copy Markdown
Contributor

@mshibuya i see the same issue.

@lazebny

lazebny commented Feb 11, 2017

Copy link
Copy Markdown
Contributor

@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'})

Copy link
Copy Markdown
Contributor Author

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.

Copy link
Copy Markdown
Contributor

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.

@Eversilence

Copy link
Copy Markdown

I am having the same issues with forms.. Would be great if proposed PR would be merged

@mshibuya mshibuya merged commit bfdcf35 into railsadminteam:master Feb 13, 2017
@mshibuya

Copy link
Copy Markdown
Member

Merged in, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants