ruby on rails - Ransack : Undefined Method "result" -
i need use ransack , install gem , restart server , writed in controller :
def index
@q = sound.search(params[:q]) @sounds = @q.resultend
and in view :
<%= f.label :title_cont %> <%= f.text_field :title_cont %> <%= f.submit "search" %>
but have error :
undefined method `result' #activerecord::relation:0x007fa185e9c2c0>
i try found answer doesn't work.
thanks help
edit : find solution , use other gem : sunspot , work.
thank's help.
i have had same issue.
i found solution here https://github.com/activerecord-hackery/ransack/issues/266
i changed
@q = sound.search(params[:q]) @sounds = @q.result to
@q = sound.ransack(params[:q]) @sounds = @q.result i think activeadmin had overwritten search method so, explained in link above, ransack method has been created run search in case gem has used 'search'.
Comments
Post a Comment