Re: hi,about session_path variable

creativetags
Wed, 16 Apr 2008 15:06:03 -0000

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

On Mar 14, 12:17 am, Doug <dou...-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
wrote:
> 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.
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com