I have this button in a view:
<%= button_to 'Add Review', {controller: 'reviews', action: 'new', id: booking.showing.film.id } %>
Which then sends the user to the new review path and uses the film's id to enable the new review form to know what film is being reviewed. This is done through the routes:
post 'reviews/new/:id', to: 'reviews#new'
But the button does not look very nice so I want a link_to. I have tried this:
<%= link_to 'Add Review', {controller: 'reviews', action: 'new', id: booking.showing.film.id } %>
But through my errors routing:
match '*a', to: 'errors#routing', via: [:get, :post]
It will send the user back to the index page and display the message: No such path as 'reviews/new/6'
How can I make a link that does exactly the same as the button?