Skip to content

Rails 5.1 form_with ActionView helper #99

@simoncal-saas

Description

@simoncal-saas

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions