A
A
Andrey Korablin2016-01-12 17:48:58
Ruby on Rails
Andrey Korablin, 2016-01-12 17:48:58

How to pass new value from show view?

When viewing an order (show.html.erb), there is a separate block that displays users who want to take this order. Next to the user there is a "give away" button with hidden fields - id.user and status.order.
When clicked, an error occurs - no routes matched [post].
Tried the form with action: => :update, controller: => :order, :method => :put but same error.
How to pass these values ​​using put or some other way?
Sorry if I didn’t describe the problem correctly or chaotically, I hope someone faced a similar problem and found a way to solve it).
If necessary, I can post the code and routes.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrew Emelianenko, 2016-01-13
@YourWest

Lay out the code better, it's very hard to understand what data you are sending where. To create or update which controller. And I advise you to read about the RESTful organization of controllers and requests.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question