Variables in URLs. Routes manipulation

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.

The links would work as you intend to as long as the routes are fine.
Thanks & Regards,
Dhruva S…

Stephen
Leacockhttp://www.brainyquote.com/quotes/authors/s/stephen_leacock.html

  • “I detest life-insurance agents: they always argue that I shall some
    day
    die, which is not so.”

On Tue, Aug 25, 2009 at 4:17 PM, Juan K. <

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