Forum: Ruby on Rails API Suggestion

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Berin L. (Guest)
on 2006-03-07 22:17
(Received via mailing list)
It's not intuitive to have two hashes on any one method call.  Most of
the view helpers have a hash for method options followed by a hash for
html options.  I find it to be problematic at best.  I think it would be
best to have one hash and then add your html options as a hash entry.
For example:

<%= link_to "All Facilities", {:action => 'fac_log_all'}, {:target =>
'_new'} %>

would become

<%= link_to "All Facilities", :action => 'fac_log_all', :html =>
{:target => '_new'} %>


Or even better, any options that are not recognized by the method are
automatically treated as html options:

<%= link_to "All Facilities", :action => 'fac_log_all', :target =>
'_new' %>



I've seen some examples done both ways, but whatever it is it should be
consistent.
This topic is locked and can not be replied to.