I have retrieved some records based on condition in a hash - @special_products
. Now I want to pass the hash to a non-restful action(:special)/ of the same controller so that I can view the products.
I've tried this but how can link_to pass hash and how should the value be retrieved in action: special?
which is in the same products_controller?Many thanks.
products_controller.rb
def show
@special_products = Product.by_company
end
show.html.erb
<%= link_to "Special Products", special_path(:anchor => "#{@special_products}") %>