Can we make just one restful action singular?

Here's my situation.

I have a user model. Hence:
[code]
ActionController::Routing::Routes.draw do |map|
  ...
  map.resources :users
  ...
end
[/code]

But now the problem is whenever a user wants to edit his profile the
corresponding path for this job will be /users/:id/edit . Now it's
needless to say that using this mechanism is not at all secure since the
:id can be changed by the user in the url. That would save those changes
in some other user's record. However that is not the issue here since
that has been taken care of in:

[code]
def edit
 @user = current_user
end
[/code]

So now generating /users/:id/edit is futile. How can I generate
/users/edit ??? However I want to keep it restful.


Regards,

Utsav
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to