Hi,
I have invoices, each belonging to different fiscal years. When browsing
my app you are navigation seeing information about the current fiscal
year but I would like to allow the users to change to another fiscal
year and browse the same way through old information.
I’ve been considering storing the fiscal_year in session and use a
default_scope to query for invoices from the fiscal_year the user is
browsing. But someone adviced me to put the fiscal_year variable in the
URL in order to allow navigation in different fiscal_years for one user
at the same time.
How can I implement this feature? The idea is browsing always a URL like
http://localhost:3000/2009/invoices/new or
http://localhost:3000/2009/invoices/search → http://localhost:3000/<%=
session[:fiscal_year] %>/controller/action/id
Is it possible? Would it be restful? Where can I find more info about
implementing this? The links will work the same after implementing this
solution? Do you recommend any other solution?
Thanks.