title: No Ransack::Search object was provided to search_form_for
body: <p>I realise other people have asked about this error but it was to do with a different circumstance. </p>
  
  <p>I have added the Ransack gem for rails 4 and bundled installed with:</p>
  
  <pre><code>gem "ransack", github: "activerecord-hackery/ransack", branch: "rails-4"
  </code></pre>
  
  <p>I have also edited my controller as follows (recipes_controller):</p>
  
  <pre><code>def index
  if params[:tag]
    @all_recipes = Recipe.tagged_with(params[:tag])
  else
    @all_recipes = Recipe.all
  end
  if signed_in?
    @user_recipes = current_user.recipes.order("created_at DESC").paginate(page: params[:page], :per_page =&gt; 10)
  end
  if params[:q]
    @q = Recipe.search(params[:q])
    @all_recipes = @q.result(distinct: true)
  end
  end
  </code></pre>
  
  <p>I have then added in the form as follows (recipes/index):</p>
  
  <pre><code>&lt;%= search_form_for @q do |f| %&gt;
    &lt;%= f.label :name_cont %&gt;
    &lt;%= f.text_field :name_cont %&gt;
    &lt;%= f.submit %&gt;
  &lt;% end %&gt;
  </code></pre>
  
  <p>I am receiving the following <strong>error</strong>: </p>
  
  <pre><code>No Ransack::Search object was provided to search_form_for!
  </code></pre>
  
  <p>on this line: </p>
  
  <pre><code>&lt;%= search_form_for @q do |f| %&gt;
  </code></pre>
  
  <p>Would this be something to do with the install?</p>