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 wi
Nicolas was right in that the error is coming from @q
only being initialized when the request contains a "q" parameter. Which is why before you submit the form you get the error (no "q" parameter).
another way to get around this is initializing @q
in your application_controller
def set_search
@q=Recipe.search(params[:q])
end
in your recipes_controller
before_filter :set_search