[Rails] Re: get & post methods in controller's test
7stud -- wrote in post #1074532:
> Your route syntax is confusing to me. How about:
>
>
> controller :sessions do
> match '/login' => :login_create, :via => :post
> match '/login' => :login, :via => :get
> match '/logout' => :logout
> end
>
> ...which is pieced together from here:
>
> http://api.rubyonrails.org/classes/ActionDispatch/Routing.html
Equals effect, but the one I've used is more succinct :)
It also explained in "HTTP helper methods" paragraph of the linked api.
The problem isn't in the route, but in the strange behavior of get and
post, instance methods of ActionController::TestCase::Behavior
--
Posted via http://www.ruby-forum.com/.
--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home