Skip to content

Supporting form_with in Rails 8.0 #33

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jiko797torayo
Copy link

@amatsuda

I have created a PR to fix this issue💪
Please review it when you have a moment.

Close #32

Thank you for the wonderful gem✨

When I tried to upgrade a Rails application that using this gem to Rails 8.0, the following error occurred.

ActionView::Template::Error (Passed nil to the :model argument, expect an object or false)
Caused by: ArgumentError (Passed nil to the :model argument, expect an object or false)

Information for: ActionView::Template::Error (Passed nil to the :model argument, expect an object or false):
    1: <%= form_with url: '/search', id: 'form_with' do |f| %>
    2: <%= f.search_field :query, id: 'query' %>
    3: <% end %>

The cause is that the default value of the model: argument of form_with was changed from nil to false in Rails 7.2, and passing nil to the model: argument causes an error in Rails 8.0.

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.

Supporting form_with in Rails 8.0
1 participant