# Simple Problem

**URL:** <https://www.ruby-forum.com/t/simple-problem/133011>\
**Category:** Rails\
**Created:** [March 26, 2008, 6:20pm UTC](https://www.ruby-forum.com/t/simple-problem/133011 "2008-03-26T18:20:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sjglazer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ee59a6/32.png) [@sjglazer](https://www.ruby-forum.com/u/sjglazer)\
**Post date:** [March 26, 2008, 6:20pm UTC](https://www.ruby-forum.com/t/simple-problem/133011/1 "2008-03-26T18:20:04Z")

</div>

Hi there,

I am building an application that stores the delivery boundaries of  
businesses. I have a separate table called boundaries that has fields  
for the latitude and longitude. Each business can have many of these  
boundary points and I use google maps with markers to capture the  
information.

No my problem is this - when a user wishes to edit a business I need to  
display the delivery area in a google maps using a javascript function.  
How can I pass the list of boundaries associated with the business to a  
javascript function?

Thanks,  
steve

---

<div class="post-metadata">

**Author:** ![sjglazer](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/ee59a6/32.png) [@sjglazer](https://www.ruby-forum.com/u/sjglazer)\
**Post date:** [March 26, 2008, 6:29pm UTC](https://www.ruby-forum.com/t/simple-problem/133011/2 "2008-03-26T18:29:29Z")

</div>

On Wed, Mar 26, 2008 at 06:20:04PM +0100, Steve G. wrote:

> I am building an application that stores the delivery boundaries of  
> businesses. I have a separate table called boundaries that has fields  
> for the latitude and longitude. Each business can have many of these  
> boundary points and I use google maps with markers to capture the  
> information.
> 
> No my problem is this - when a user wishes to edit a business I need to  
> display the delivery area in a google maps using a javascript function.  
> How can I pass the list of boundaries associated with the business to a  
> javascript function?

You’ll have a script tag in your view. Here’s some rough pseudocode:

Your JS code can now refer to old\_boundaries for the set of points.

> Thanks,  
> steve  
> –Greg
