Rails 3 refactoring issue
- by Craig
The following view code generates a series of links with totals (as expected):
<% @jobs.group_by(&:employer_name).sort.each do |employer, jobs| %>
<%= link_to employer, jobs_path() %> <%= "(#{jobs.length})" %>
<% end %>
However, when I refactor the view's code and move the logic to a helper, the code doesn't work…