[Ruby] Preserving State

ben wiseley wiseleyb at gmail.com
Tue Dec 5 12:50:04 PST 2006


While kind of new to Rails myself I'm pretty sure you can't connect to 24
databases... so hopefully you meant tables.  (Although I've never looked
into multi-db support in Rails - so I could be full of it)

Typically paging stuff is done by passing page number and direction on the
url.  See how we're doing paging on http://activerain.com/states/CA or
http://activerain.com/blogs?blog_group_id=all_blogs_no_ads&sort_key=date_asc&date_key=-1

As an old .Net programmer I can assure you that doing all kinds of silliness
with urls is 10,000 times easier on Rails than .Net.

I can send you sample source code for doing large scale paging (by large
scale I mean something more than 10,000 rows) if you need it - the built in
rails page helper thingy isn't really suitable for large datasets (or even
small ones if you have tons of traffic  :).

-ben

On 12/5/06, Neil Moomey <neil at motznik.com> wrote:
>
> Thanks for the answers.  Let me give you more info so we can descide if
> session is appropriate for my case.  I'm just concerned if it's
> overkill.  I
> plan on using sessions for other things and don't want to clutter it up or
> drain the server.
>
> My application allows people to search databases with the results paging
> 20
> results at a time foreward and backwards.
>
> Search page example:
> Enter: Address, City, State, Zip
>
> This returns distinct addresses in alphabetical order such as:
> 408 N PINE ST
> 516 N PINE ST APT 7
> 532 N PINE ST
> etc
>
> They can then click on Prev or Next to go backwards or forewards or click
> on
> the address to refine the search.  Now I do this for 24 different
> databases,
> each with unique fields to search on.  Here is a screenshot of our current
> application I designed in c# :
> http://www.motznik.com/img/mo_screenshot_l.gif
>
> 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