Utsav Gupta wrote:
> 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. 

You mean you don't have a permissions system in place?

> 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.
> 

/users/edit would seem like it's supposed to edit *all* users.  You 
probably want something like /user/edit .

Best,
--
Marnen Laibow-Koser
http://www.marnen.org
[email protected]

> 
> 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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to