JDutil / contact_us

Gem providing simple Contact Form functionality with a Rails 3+ Engine.
http://contact-us-demo.herokuapp.com
MIT License
134 stars 57 forks source link

Routing Error: No route matches [GET] "/en/contacts" #65

Closed viktorianer closed 7 years ago

viktorianer commented 7 years ago

After submitting contact form with some errors (e.g. empty email) the action create in controller ContactsController renders this route: http://localhost:3000/en/contacts and shows form errors. Witch is nice.

If you refresh the page now, you will get: Routing Error: No route matches [GET] "/en/contacts"

_Routes match in priority from top to bottom: ... contacts_path POST (/:locale)/contacts(.:format)
contact_us/contacts#create {:locale=>/en|de/}

new_contact_path GET (/:locale)/contacts/new(.:format)
contact_us/contacts#new {:locale=>/en|de/}

contact_us_path GET (/:locale)/contact-us(.:format) contactus/contacts#new {:locale=>/en|de/}

You have only [POST] _contactspath, but no any [GET] on this route.

JDutil commented 7 years ago

This is the normal CRUD behavior in Rails controllers. If you want to allow the page to be reloaded you can add a route to the route file, but users should not have to.