I realise other people have asked about this error but it was to do with a different circumstance.
I have added the Ransack gem for rails 4 and bundled installed with:
gem "ransack", github: "activerecord-hackery/ransack", branch: "rails-4"
I have also edited my controller as follows (recipes_controller):
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 => 10)
end
if params[:q]
@q = Recipe.search(params[:q])
@all_recipes = @q.result(distinct: true)
end
end
I have then added in the form as follows (recipes/index):
<%= search_form_for @q do |f| %>
<%= f.label :name_cont %>
<%= f.text_field :name_cont %>
<%= f.submit %>
<% end %>
I am receiving the following error:
No Ransack::Search object was provided to search_form_for!
on this line:
<%= search_form_for @q do |f| %>
Would this be something to do with the install?