On Mar 11, 2014, at 4:59 PM, Colin Law wrote:

> On 11 March 2014 10:27, Arun kant sharma <iarunk...@gmail.com> wrote:
>> My question is that why link_to method does not default to DELETE method
>> when passed link is destroy_user_session_path as we know from routes what it
>> should use. I don't have problem passing method: :delete but it feels
>> redundant.
> 
> You are missing what the purpose of routes.rb is.  It is to tell the
> system what to do when a request is received (how to route it in
> fact).  It is nothing to do with generating the code in the views.

True, the routes file doesn't generate the views directly, but doesn't the 
routes file generate or seed the url helpers? When I type in 

<%= widgets_path %> 

in a view, that's coming (somewhat) directly from the line 

  resources :widgets 

in the routes.rb, right?

Walter

> 
> Colin
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Ruby on Rails: Talk" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to rubyonrails-talk+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-talk@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/rubyonrails-talk/CAL%3D0gLunzhkcUqzhPAfhm79FUBLZ9bB_ZJs%2B64EdP76xEOHuvA%40mail.gmail.com.
> For more options, visit https://groups.google.com/d/optout.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/5A70CB46-EC9E-4498-9692-71CD78C729D4%40wdstudio.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to