Thanks for the help, it works like a charm but I still don’t understand
why the 3 comma delimited parameters ‘Cancel’, :action => ‘list’, :class
=> ‘btn-cancel’ does not fit into title, url, options
Why :action => ‘list’, :class => ‘btn-cancel’ are interpreted as the
second parameter ? I thought that {:action => ‘list’, :class =>
‘btn-cancel’} only would produce that !?
I think it’s because if you don’t put braces around your parameters, the
method thinks that anything after the first parameter is part of the
second parameter. As a general rule if you have more than 2 parameters
for link_to or the like kind of methods, you should put in braces to
indicate exactly what you want. I believe this is part of Ruby’s
programming idiom.
Nuno wrote:
Thanks for the help, it works like a charm but I still don’t understand
why the 3 comma delimited parameters ‘Cancel’, :action => ‘list’, :class
=> ‘btn-cancel’ does not fit into title, url, options
Why :action => ‘list’, :class => ‘btn-cancel’ are interpreted as the
second parameter ? I thought that {:action => ‘list’, :class =>
‘btn-cancel’} only would produce that !?