# Widgets within a page?

**URL:** <https://www.ruby-forum.com/t/widgets-within-a-page/72180>\
**Category:** Radiant CMS\
**Created:** [October 15, 2006, 4:59am UTC](https://www.ruby-forum.com/t/widgets-within-a-page/72180 "2006-10-15T04:59:31Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [October 15, 2006, 4:59am UTC](https://www.ruby-forum.com/t/widgets-within-a-page/72180/1 "2006-10-15T04:59:31Z")

</div>

Hi guys, I need a bit of advice… I’m fairly new to Rails, the most  
I’ve done is get it running and install Radiant for a project I’m  
working on… so I havent actually done any rails code as yet… =]

Anyway, I need to implement a type of Ajax livesearch widget on one fo  
my pages within Radiant. All it will do is lookup a table in a mysql  
db and display the results in a div. Now I’ve used  
prototype+scriptaculous before, so I know I can do the front-end part  
with plain HTML+Javascript… but I’m not sure where to start with the  
backend bit that actually looks up the table, and how to integrate it  
with my Radiant site, and stuff like that…

Any help would be greatly appreciated…!

Cheers,

Michael

---

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [October 15, 2006, 6:09am UTC](https://www.ruby-forum.com/t/widgets-within-a-page/72180/2 "2006-10-15T06:09:35Z")

</div>

Michael,

I believe that there is a Search behavior which will do most of what you  
want already. I haven’t used it much but I think it can also do all the  
livesearch stuff for you.

You can get it from  
[http://nobits.org/articles/2006/06/10/radiant-search-behaviour/](http://nobits.org/articles/2006/06/10/radiant-search-behaviour/)

Chris

---

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [October 15, 2006, 7:43am UTC](https://www.ruby-forum.com/t/widgets-within-a-page/72180/3 "2006-10-15T07:43:41Z")

</div>

Thanks for the reply Chris, but I’m not actually trying to search the  
content of my Radiant pages, but rather a table of countries and call  
rates, ie. if the user enters ‘un’ in the live search field, it would  
display

* * *

## United Arab Emirates - $0.69 United Kingdom - $0.04 United States - $0.04

in a updated div… any suggestions?

Cheers,

Michael

---

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [October 15, 2006, 11:14pm UTC](https://www.ruby-forum.com/t/widgets-within-a-page/72180/4 "2006-10-15T23:14:48Z")

</div>

> Thanks for the reply Chris, but I’m not actually trying to search the  
> content of my Radiant pages, but rather a table of countries and call  
> rates, ie. if the user enters ‘un’ in the live search field, it would  
> display
> 
> * * *
> 
> ## United Arab Emirates - $0.69 United Kingdom - $0.04 United States - $0.04
> 
> in a updated div… any suggestions?

Maybe you should be trying to search the content of your Radiant pages!

What about creating a Countries page w/ all the countries as sub-pages,  
with the price as a part? Plus a simple SQL query to copy the Countries  
table data to the Pages table and restrict the livesearch to that page &  
its children, presto!

-jamie

---

<div class="post-metadata">

**Author:** ![roa](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/8e7dd6/32.png) [@roa](https://www.ruby-forum.com/u/roa)\
**Post date:** [October 16, 2006, 1:11am UTC](https://www.ruby-forum.com/t/widgets-within-a-page/72180/5 "2006-10-16T01:11:34Z")

</div>

Hi Jamie,

My list of rates has 550+ countries, and I have to import them again  
every time I get an updated list… having them as Radiant pages may  
get a bit unmanagable… =]

cheers,

michael
