the probleme is when i want to delete the user, it do the same like i
want to show him and the view rended is the same of showing user : http://localhost:3000/users/1
in the routes.rb there’s resources
:users
resources :user_admins, :only => [:index] do
collection do #operate on all ressources, not on a specific one
…
…
end
end
what can i do to resolve this probleme please.
thanks
http://localhost:3000/users/1 is the correct URL for deleting a user.
However, it should be sent with a “method” of “delete” instead of “get”.
That’s what this snippet of code is for:
method => :delete
If it’s not working properly from your first example, you probably don’t
have jQuery/Prototype UJS setup properly. Can you confirm that?
It’s very bad form to have a “get” link delete an object in the
database.
What happens if a web crawler or bot clicks on all the links on your
page?
All your items will be deleted.