# Passing parameters from Ruby to JS. Please Help

**URL:** <https://www.ruby-forum.com/t/passing-parameters-from-ruby-to-js-please-help/107109>\
**Category:** Rails\
**Created:** [June 18, 2007, 8:19am UTC](https://www.ruby-forum.com/t/passing-parameters-from-ruby-to-js-please-help/107109 "2007-06-18T08:19:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Anton\_Kalachev](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/c68b51/32.png) [@Anton\_Kalachev](https://www.ruby-forum.com/u/Anton_Kalachev)\
**Post date:** [June 18, 2007, 8:19am UTC](https://www.ruby-forum.com/t/passing-parameters-from-ruby-to-js-please-help/107109/1 "2007-06-18T08:19:05Z")

</div>

Hi,

I am using Ext Grid to draw a table.

show.rhtml page allows to access account data so the url look like  
http://\<server\_name\>/\<project\_name\>/show/1, where 1 is an account id.

show.rhtml has the following code:

\<%= javascript\_include\_tag “grid.js” %\>

grid.js is used for grid initialization and rendering it accesses the  
“\<project\_name\>/grid\_data” method that is in the project controller

grid\_data forms the jsondata for the grid.

The problem: grid.js has no idea for what account the grid is  
rendered. However, account id is required in grid\_data to provide a  
proper json data. How do I pass account id from “show.rhtml” to  
“grid.js”?

Thanks for your help.
