How do you perform removal and railing operations? I read the documentation and thought that I was doing everything right, but I can not get it to work.
For example, if I wanted to remove an employee, I would create a controller called "EmployeesController" and create a destroy method to perform the removal.
Then I went into the route.rb file and entered map.resources :employees , which gives you access to the URL helper functions.
In what I want to call the Ajax operation, I should only have a line:
<%= link_to_remote "Delete", employee_path(@employee), :method => :delete %>
When I click on the link, it still sends the POST operation, so it does nothing.
What am I missing or is something wrong?
rest ruby-on-rails
Chris R.
source share