btw, I usually also add the following to my routes:

  map.login '/login', :controller => 'sessions', :action => 'new'

on top of

  map.logout '/logout', :controller => 'sessions', :action => 'destroy'


-Matt


On 8/16/07, Glenn Little <[EMAIL PROTECTED]> wrote:
>
> I'm using restful auth as well.  I have shortcut route set
> up for "/logout":
>
>   map.logout  '/logout', :controller => 'sessions', :action => 'destroy'
>
> The destroy() action doesn't need session info passed to it
> since it looks it up itself based on the session info.  So the
> logout button can be something simple like:
>
>   <%= button_to("logout", "/logout")%>
>
> link_to should work similarly I think.
>
>         -glenn
>
>
> richard apodaca wrote:
> > I'm building an app using restful_authentication. It
> > works great, but I have a question about logging out.
> >
> > I currently give the user a "logout" button built
> > from:
> >
> > link_to "logout", session_url(session.id), :method =>
> > :delete
> >
> > This constructs a URL like:
> >
> > http://localhost:3000/sessions/-611266728
> >
> > Now, on the face of it, I can't see anything wrong,
> > but it just doesn't smell right to so clearly spell
> > out how sessions work for an app.
> >
> > In digging around, I did find this:
> >
> > http://www.ruby-forum.com/topic/82348
> >
> > which seems to suggest that the way I'm doing it is
> > the way the plugin was designed to be used:
> >
> > Any experience with this issue out there?
> >
> > many thanks,
> > Rich
> >
> > ____________________________
> > Richard Apodaca
> > Blog: http://depth-first.com
> > _______________________________________________
> > Sdruby mailing list
> > [email protected]
> > http://lists.sdruby.com/mailman/listinfo/sdruby
> _______________________________________________
> Sdruby mailing list
> [email protected]
> http://lists.sdruby.com/mailman/listinfo/sdruby
>
_______________________________________________
Sdruby mailing list
[email protected]
http://lists.sdruby.com/mailman/listinfo/sdruby

Reply via email to