1

I've got an action in my routes.rb file:

post '/deliveries/:id/confirm' => 'deliveries#confirm', :as => 'delivery_confirm'

When I'm using a view for the deliveries controller, I can just use the delivery_confirm_path helper and all is well with the world.

What I've also got is something adding lines to the delivery, and this sends an AJAX request to the create action in the lines controller. The response updates the delivery page, and most of it works.

But when I try to use one of the path helpers for deliveries I get back the following error message:

No route matches {:controller=>"deliveries", :action=>"confirm"}

Is there any reason why I can't use the deliveries path helper from a delivery lines view?

1 Answer 1

2

You're missing the id parameter or you're not calling the post verb.

delivery_confirm_path(@delivery)
Sign up to request clarification or add additional context in comments.

1 Comment

Ahh simple! Had a bit of a problem with parentheses that I need to do a bit more digging on.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.