Forum: Ruby on Rails real time search results

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
B1d0b409ee9c49b67556748d268df420?d=identicon&s=25 george (Guest)
on 2006-06-01 16:10
I am new to ruby and rails and am unsure how to accomplish the
following:

I'd like to have a page where the user enters a value in a form field
and have results stream into a results div on the page.  Additionally, I
want to:
- Not limit the result set
- Allow user to get immediate feedback on what they have entered
- Allow user to change field contents as results are appearing
- Have query restart when field value changes

Can anyone point me to an appropriate reference or suggest Rails
constructs to research?

Thanks in advance.
Da828b27a295fe67c31a4d64f751d6cd?d=identicon&s=25 Victor Fan (victorfan88)
on 2006-06-01 16:54
george wrote:
> I am new to ruby and rails and am unsure how to accomplish the
> following:
>
> I'd like to have a page where the user enters a value in a form field
> and have results stream into a results div on the page.  Additionally, I
> want to:
> - Not limit the result set
> - Allow user to get immediate feedback on what they have entered
> - Allow user to change field contents as results are appearing
> - Have query restart when field value changes
>
> Can anyone point me to an appropriate reference or suggest Rails
> constructs to research?
>
> Thanks in advance.

Hi George

Take a look at the "Agile Web development with Rails" book, there is a
section about Ajax and one of its example is "Build Real-time searches
with observers".

Hope this helps :)

Victor
B1d0b409ee9c49b67556748d268df420?d=identicon&s=25 george (Guest)
on 2006-06-01 18:19
Victor Fan wrote:
> george wrote:
>> I am new to ruby and rails and am unsure how to accomplish the
>> following:
>>
>> I'd like to have a page where the user enters a value in a form field
>> and have results stream into a results div on the page.  Additionally, I
>> want to:
>> - Not limit the result set
>> - Allow user to get immediate feedback on what they have entered
>> - Allow user to change field contents as results are appearing
>> - Have query restart when field value changes
>>
>> Can anyone point me to an appropriate reference or suggest Rails
>> constructs to research?
>>
>> Thanks in advance.
>
> Hi George
>
> Take a look at the "Agile Web development with Rails" book, there is a
> section about Ajax and one of its example is "Build Real-time searches
> with observers".
>
> Hope this helps :)
>
> Victor

Victor,

Thanks, I've looked at that and implemented something using this
construct, but with large result sets, there is too long a delay before
the data appears.  And when it does, it's all at once.  I'm wanting to
view in real time the data being found.  A simple meaningless example
would be that each record contains a number 1 to a million.  When the
user starts typing a 1, the results would include 1, 10-19, 21, 31, 41,
etc. and would continue to be added to if the user typed nothing else.
If the user adds another 1, then the results box starts over -
displaying 11, 110, 111, 112, 113, etc. and again continues.

Any ideas how that can be accoumplished?

g

g
89d967359903c639d31e4cad4569f537?d=identicon&s=25 Charlie Bowman (Guest)
on 2006-06-01 18:33
(Received via mailing list)
If you're pulling the results from a database, I'm not sure you can
stream them.  Database's return the results all at once, not one at a
time as it's found.


On Thu, 2006-06-01 at 18:19 +0200, george wrote:

> >> - Allow user to change field contents as results are appearing
> > section about Ajax and one of its example is "Build Real-time searches
> the data appears.  And when it does, it's all at once.  I'm wanting to
>
> g


Charlie Bowman
http://www.recentrambles.com
B1d0b409ee9c49b67556748d268df420?d=identicon&s=25 george (Guest)
on 2006-06-01 19:02
Charlie Bowman wrote:
> If you're pulling the results from a database, I'm not sure you can
> stream them.  Database's return the results all at once, not one at a
> time as it's found.
>
>
> On Thu, 2006-06-01 at 18:19 +0200, george wrote:
>
>> >> - Allow user to change field contents as results are appearing
>> > section about Ajax and one of its example is "Build Real-time searches
>> the data appears.  And when it does, it's all at once.  I'm wanting to
>>
>> g
>
>
> Charlie Bowman
> http://www.recentrambles.com

True, that gives me an idea of a few things to try.  Thanks

g
This topic is locked and can not be replied to.