Skip to content
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

Can't get form_with to work from a cell in Rails 6 #484

Open
marnen opened this issue Apr 10, 2020 · 3 comments
Open

Can't get form_with to work from a cell in Rails 6 #484

marnen opened this issue Apr 10, 2020 · 3 comments

Comments

@marnen
Copy link

marnen commented Apr 10, 2020

I just tried to use Cells with a Rails 6 application, and failed when trying to generate a (non-model-based) form. Even though I included ActionView::Helpers::FormHelper into the cell, form_with (and form_tag) always failed with NoMethodError: undefined method `[]' for nil:NilClass. Any ideas as to how to get this to work?

@apotonick
Copy link
Member

@marnen
Copy link
Author

marnen commented Apr 11, 2020

@apotonick i did use cells-rails when I had the problem. I can file an issue there if it would be better.

@marnen
Copy link
Author

marnen commented Apr 11, 2020

I think I figured out the issue. I used new instead of the cell helper method to render the cell, so cells-rails didn't get a chance to set up the context properly. Once I used the cell helper, everything worked. Leaving this open only because it might be worth documenting this gotcha.

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

No branches or pull requests

2 participants