Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Viewing all articles
Browse latest Browse all 4622

undefined method `name_cont' for Ransack::Search

$
0
0

I was trying to use the ransank gem. But for some reason I get

undefined method `name_cont' for Ransack::Search>:Ransack::Search

users_controller.rb

def index    @q = User.ransack(params[:q])    @users = @q.result    @users = User.order(:id).includes(:employers)    @users = User.order('last_name  ASC').page(params[:page]).per_page(2)    #Adding CSV export    respond_to do |format|      format.html      format.csv { send_data @users.to_csv }    end  end

My index.html.erb

<%= f.label :name_cont %><%= f.search_field :name_cont %><%= f.submit %> <% end %>

Viewing all articles
Browse latest Browse all 4622


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>