title: Grouping 2 lines of code in a helper method
body: <p>I have a method in my application_helper and 2 lines of code (the last ones in a method) that won't work if they both are active. How to group them in the proper way? (Choosing a code line depends on what page user opens).</p>
  
  <pre><code>def sortable(column, title = nil)
    title ||= column.titleize
    css_class = sort_column ? "current #{sort_direction}" : nil
    direction = sort_column &amp;&amp; sort_direction == "asc" ? "desc" : "asc"
    link_to title, params.merge(sort: column, controller: 'analyze/consumptions', action: 'grid_report' , direction: direction), {class: css_class, remote: true, method: 'post'}
    link_to title, params.merge(sort: column, controller: 'admin/users', action: 'records' , direction: direction), {class: css_class}
  end
  </code></pre>