learn-rails icon indicating copy to clipboard operation
learn-rails copied to clipboard

Rails 5.1 form_with ActionView helper

Open simoncal-saas opened this issue 8 years ago • 0 comments

Re: Chapter 19, Section "Adding a Form to the Contact Page".

Error encountered and recorded in /app/log/development.log:

ActionView::Template::Error - wrong number of arguments (given 1, expected 0): actionview (5.1.2) lib/action_view/helpers/form_helper.rb:715:in form_with' app/views/pages/contact.html.erb:4:in _app_views_pages_contact_html_erb__2365087659624534846_70041057497600'

Resolution: Replace <%= form_with(:contact, url: contact_path) do |form| %> with <%= form_with(scope: :contact, url: contact_path) do |form| %> in /app/views/pages/contact.html.erb

simoncal-saas avatar Jul 19 '17 04:07 simoncal-saas