Re: hi,about session_path variable

Doug
Thu, 13 Mar 2008 23:17:38 -0000

haha ...let''s try this again!
I think I hit the wrong "reply" button the first time.

On Mar 12, 10:56 pm, "Vincent.Z"
<zhu1...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:
> i use the restful_authentication plugin,i found one line in
> new.html.erb file as following:
>
> <% form_for session_path do -%>
>
> the session_path is a variable?
> i can not find anything definition about it.
>
> thanks a lot!

I just set this up....

session_path is a view helper mapping a route to the create action.
Rails provides this dynamically (right?) because session is a
singleton Resource.

In your routes.rb file there is/should be:
map.resource :session

This gives you named routes(RESTful) and view helpers.
....is that cool or what!

for more info and examples, see api:
http://api.rubyonrails.org/classes/ActionController/Resources.html

all this was created when you ran the generator in
restful_authentication.
You provided the word "session" ...some use "account".
..I''m forgetting which one is default...I thought the readme was very
good.