In my domain, a user chooses a Universe to edit, then can view/edit/destroy etc. models associated with the Universe they choose. Basically, the entire website depends on which Universe you are currently viewing.
I had just been passing which Universe in the params, but this is quickly getting untractable. Is there a rails standard way to keep track of what the last Universe a user selected was? Should I store this information in some sort of cookie? Should I make some sort of weird singleton model to keep the data in? Is there way to use the Session (like you would for keeping track of which user is logged in)?
session[:universe_id] = Universe.current(see alsoThread.current[:variable]to store variable accross the whole app, but is deprecated)ApplicationControllerwith abefore_filtercan solve nicely.current_universe) in case you change your mind in the future.