hi,about session_path variable

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 have checked that helper,no such definition ,and i searched all source in my project.nothing about the session_path.

any idea?

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

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.

Hi

I'm having a similar problem with this. I've developed an application with restful_authentication and it's running fine locally under mongrel but when I deploy it to my host running fast-cgi the routes act differently.

so the line <% form_for session_path do -%>

should direct to the create action in the sessions controller (as it does locally) but instead it calls the show action.

In my routes.rb I have:   map.resource :session, :controller => 'sessions'

which should create the default routes to actions create and show (plus others) the difference being show is GET and create is POST. I've tried specifying the form_for is POST with :method => "POST" but it still directs to show (via GET).

Thanks in advance.

Mark