Hi Folks,
Hope you guys are doing good!
I am using ransack gem in my project and while generating the form for it, I am getting "undefined method 'search_form_for' for Class Object"
Here's the code snippet:
#Gemfile
gem "ransack"
#{PATH_TO_APP}/vendor/engines/my_engine/app/controllers/home_controller.rb
class HomeController < ApplicationController
def index
@search = User.ransack( params[:q] )
end
end
#{PATH_TO_APP}/vendor/engines/my_engine/app/views/home/index.html.erb
<%= search_form_for @search, url: my_url, method: :post do | f | %>
<%= f.submit "Search" %>
<% end %>
Am I missing something here?
Thanks in advance for the help!