I have the following model
class Position < ActiveRecord::Base
belongs_to :position_name
delegate :name, to: :position_name
And this search form
= search_form_for @search, url: '#', method: 'GET', html: {id: nil, class: "term_search_form"} do |f|
= f.text_field :name_cont, class: 'search-query', id: nil, placeholder: t('search')
And I still receive this error message:
undefined method `name_cont' for #<Ransack::Search:0x007f97187c5b80>
I think it is because of the delegated method name.
How can I use ransack on delegated methods?