I have a controller, named OrdersController. And db table "Orders" with information about shop orders. In a index page (localhost/) I must show two buttons: today orders and orders in range (with two inputs).
First button should open a page with list of orders, created today (Date.current for example). Second button should open a page with list of orders, that was created in date range, specified in the input .
When I click on some order the details page is opens for it. There I can edit some fields of order and click "Update" button (it must update @order and redirect to (!)previous page - if it is today orders, then open a todays order. If it is a orders in a date range - then show orders created in range that was specified).
The question: what is the best practise to pass parameters between actions? How can I say to my "update" action where to redirect_to (to page with today orders or to page with orders in range) after updating? It must be a hiiden tag with params[:start_date] or something else?
The same is for the "back" button on the Order details page. It must return to the previous page (saving all the parameters that was passed for). I was thinking about
link_to 'Back', :back
But I heared it's not a good solution.
Thx!