Answer the question
In order to leave comments, you need to log in
How to edit a service without going to another page?
Hello everyone) I want to edit services without going to another page. I use the "best_in_place" gem. There is a user's personal page user/:id and in the same page the user can add services to his page, they are displayed there. In general, I do this:
1)<% @user.services.order("created_at desc").each do |service| %>
<%= best_in_place service, :content, :path => user_path %>
<% end %> Undefined
method `service_path' error appears
I hope you can help me.))
Thank you)
Answer the question
In order to leave comments, you need to log in
The absence of the service_path method indicates that your service controller is not declared as a resource in the routes . Add to routes.rb
If for some reason this is not possible, then add the method service_path
manually to app/helpers/services_helper.rb
. The method must take 1 parameter - the id of your service and return the url to this service.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question