# Ruby on Rails with jQuery

**URL:** <https://www.ruby-forum.com/t/ruby-on-rails-with-jquery/164687>\
**Category:** Rails\
**Created:** [April 4, 2009, 12:36am UTC](https://www.ruby-forum.com/t/ruby-on-rails-with-jquery/164687 "2009-04-04T00:36:03Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigPHIL18](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f17d59/32.png) [@bigPHIL18](https://www.ruby-forum.com/u/bigPHIL18)\
**Post date:** [April 4, 2009, 12:36am UTC](https://www.ruby-forum.com/t/ruby-on-rails-with-jquery/164687/1 "2009-04-04T00:36:03Z")

</div>

Hello all,

I wrote this jQuery script that gets the id of the ul i clicked and  
saves it as a variable. How can I use this variable in my Rails  
project?

Thank you,  
Philip

---

<div class="post-metadata">

**Author:** ![bigPHIL18](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/f17d59/32.png) [@bigPHIL18](https://www.ruby-forum.com/u/bigPHIL18)\
**Post date:** [April 4, 2009, 1:08am UTC](https://www.ruby-forum.com/t/ruby-on-rails-with-jquery/164687/2 "2009-04-04T01:08:15Z")

</div>

On Apr 3, 12:29 pm, bigPHIL18 [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Hello all,
> 
> I wrote this jQuery script that gets the id of the ul i clicked and  
> saves it as a variable. How can I use this variable in my Rails  
> project?

Are you using jRails or just hand coding the jQuery stuff?

Take a look at jQuery.post method (or $.post) that will let you send  
your ID back to the server…

Cheers,  
-Mark T.
