Ask A Question

Notifications

You’re not receiving notifications from this thread.

Issues with filter with searchkick elastic rails

Fatumata Jalloh asked in Rails

I am currently on the part where you add

<% if params[:price]==bucket["key"].to_s%>
<%= link_to bucket["key"], request.params.except(:price)%>
<% else %>
<%= link_to bucket["key"], request.params.merge(price: bucket["key"]) %>
<%end%>

but I get an error:

undefined method `merge' for []:Array
Extracted source (around line #28):

@producs = Product.search "*", where: args, aggs: {category_id: {}, price: {}, condition: {}, created_at:{}}

I've looked online but I don't see any sources for it. I would really appreciate any help!

Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 86,946+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.