pretty simple bit of ruby code is working fine when run on localhost but breaks when pushed up to heroku. Here it is:
<ul>
<% @regulars.each do |r| %>
<li>
<%=h link_to (image_tag small_avatar_url(r.user), :class => "u_profile_img_small", :title => r.user.name), r.user %>
</li>
<% end %>
</ul>
And here is the error in Heroku Logs referring to the link_to line above:
ActionView::Template::Error (wrong number of arguments (2 for 1))…
What gives? Any ideas?
Thanks!
When you have multiple encapsulated method calls, Ruby needs the proper parentheses so it knows which arguments go with which method. You can have the first method call without parentheses (
hin this case), but the rest are needed.<%=h link_to(image_tag(small_avatar_url(r.user), :class => "u_profile_img_small", :title => r.user.name), r.user) %>