Passing same params through several controllers

Model Product

#has weight
end

ProductController
def list
top = params[:top] #positive integer
#select how many product based on weight from highest to lowest as
much as ‘top’ element
#for example: list?top=10, only list the top 10 heaviest product

end

def edit
#edit product
#redirect to list
end

so in browser http://localhost/product/list?top=10
i will get the top 10 heaviest product
i edit on of the product
then it will bounce back to list?top=10 instead of list

the question is: how can i maintain the params[:top] across several
methods in 1 controller or several controllers?

Thank you

Store in session variable

Sent from my iPhone

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs