ArgumentError - wrong number of arguments (given 2, expected 0..1): sorting issue Rails 4.2
<p>I am facing this sort issue:</p>

<blockquote>
  <p>ArgumentError - wrong number of arguments (given 2, expected 0..1):<br>
  actionpack (4.2.6) lib/action_dispatch/routing/url_for.rb:156:in
  <code>url_for'   actionview (4.2.6)
  lib/action_view/routing_url_for.rb:94:in</code>url_for'   actionview
  (4.2.6) lib/action_view/helpers/url_helper.rb:181:in <code>link_to'<br>
  app/helpers/application_helper.rb:7:in</code>sortable'<br>
  app/views/contacts/_sort.html.erb:3:in
  `_app_views_contacts__sort_html_erb</p>
</blockquote>

<p>This is my application_helper.rb:</p>

<pre><code>  def sortable(column, title = nil)
    title ||= column.titleize.downcase
    css_class = column == sort_column ? "current #{sort_direction}" : nil
    direction = column == sort_column &amp;&amp; sort_direction == "asc" ? "desc" : "asc"
    link_to title, params.merge(:sort =&gt; column, :direction =&gt; direction, :page =&gt; nil), {:class =&gt; css_class}
  end
</code></pre>

<p>In the above code, link_to is the line I am getting error in log.
This is my _sort.html.erb(rendered from index file):</p>

<pre><code>&lt;div id="sort_control"&gt;&lt;a href="#"&gt;sort&lt;/a&gt;&lt;/div&gt;
&lt;ul class="sort" style="display:none;"&gt;
    &lt;li&gt;&lt;%= sortable "created_at" %&gt;&lt;/li&gt; #here I am getting error
    &lt;li&gt;&lt;%= sortable "firstname" %&gt;&lt;/li&gt;
  &lt;li&gt;&lt;%= sortable "lastname" %&gt;&lt;/li&gt;
  &lt;li&gt;&lt;%= sortable "email" %&gt;&lt;/li&gt;
&lt;/ul&gt;
</code></pre>

<p>This is my controller method:</p>

<pre><code>def index
    @contacts = Contact.search(params[:search]).order(sort_column + " " + sort_direction).paginate(:per_page =&gt; 60, :page =&gt; params[:page])
end
</code></pre>