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 %>
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.
The cause is that the default value of the
model:argument ofform_withwas changed fromniltofalsein Rails 7.2, and passingnilto themodel:argument causes an error in Rails 8.0.