I think the link_to helper method is quite confusing with its arguments
order:
link_to body, url
link_to Click me, @person
Why is it thay way round? I want to make a link to [the] person, so I
would expect the order to be:
link_to @person, Click me
It reads much more natural. You
A less destructive approach would be to use Ruby 2.0's named arguments to have
something like:
link_to url: @person, body: Click me
That being said, I understand your point, but don't see it as a particular pain.
On Mar 15, 2013, at 12:58 PM, Michael Grohn wrote:
I think the link_to helper
On Mar 15, 2013, at 8:58 AM, Michael Grohn wrote:
I think the link_to helper method is quite confusing with its arguments order:
link_to body, url
link_to Click me, @person
Why is it thay way round? I want to make a link to [the] person, so I would
expect the order to be:
@Matt jones
I'd guess that it's because while the body is typically simple (a string
or variable), the second argument can also be a bunch of params for
url_for:
link_to 'thingy', :controller = 'wat', :action = 'huh', :protocol =
'wtf'
There are 4 signatures for the link_to helper
On Mar 15, 2013, at 2:39 PM, Michael Grohn wrote:
@Matt jones
I'd guess that it's because while the body is typically simple (a string or
variable), the second argument can also be a bunch of params for url_for:
link_to 'thingy', :controller = 'wat', :action = 'huh', :protocol =