Even better only generate ''edit'' links if you made the post
(you''d
still want the serverside controller check to make sure people aren''t
generating the URL to try and edit other posts).
sam
On 5/21/05, Rob Park <rbpark-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> On 5/20/05, Ron Sweeney
<ron.sweeney-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> > Is there an easy way to with login_gen to turn on a mechanism where
> > you can only edit what you added in the first place.... and not other
> > posts...
>
> First, whatever it is that you want to be edited needs to "belongs_to
> User", then in the edit action in the controller, add a check to make
> sure that the user_id associated with the object is the same as the
> user invoking the action. If they''re different, throw an error.
>
> --
> Urban Artography
> http://artography.ath.cx
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>
--
sam
http://www.magpiebrain.com/