[Ruby] Preserving State
Michael Judge
mjudge at surveycomplete.com
Tue Dec 5 17:12:38 PST 2006
Hey Neil,
You can use custom routes to pass temporary variables around without
it being ugly.
/bankruptcies
/bankruptcies/date/october/2006/
/bankruptcies/status/pending/
To keep the URL clean, larger strings like a search for a name or
something could go in a session or hidden variable. The pagination
thing I'd keep in routes though. I think it looks nice.
/dmv/results/
/dmv/results/page/5
Also, using Flash as temporary storage is a bad idea. It's intended
to be a convenient way to pass messages to a view, not a convenient
way to store data for just a few requests.
From one of my controllers:
if @interview
flash[:notice] = "We're returning you to where you left off."
redirect_to :action => 'interview'
end
- Mike
On Dec 5, 2006, at 3:00 PM, Neil Moomey wrote:
> Yes, I meant 24 tables, one db.
>
> I'm reading up on sessions as well as flash. Would flash be
> appropriate? I
> like the fact that it's temporary and I can use flash.keep on every
> page
> until I'm done using it. I would prefer not to use url silliness if
> possible. My boss complained about the ugly urls we are currenly
> using.
>
> Neil
> _______________________________________________
> Ruby at zenspider.com - Seattle.rb non-commercial list
> http://www.zenspider.com/seattle.rb
> http://www.zenspider.com/mailman/listinfo/ruby
>
>
More information about the Ruby
mailing list