I have this URL for my edit form :
<%=form_for @cad,:url =>{:action => "update",:controller => "cad" } do |f| %>
And it should point to "/cad/update",but the URL is pointing to “cad/6”.
Please help.
Thanks in advance
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
it’s perfectly fine if you follow restful routes for update it’s a member route
There are 2 types of route
first one is
collection routewhich will work on in general for all object likeindexaction and second one ismember routewhich will work onspecific objectlikeshow,edit,update,destroyetc ,In your case update is member route it has http verbs is
putand it’s basicallypostrequestyou can check http method
and You don’t need url hash on form rails pick it routes based on object