# Form\_remote\_tag not providing params in Ajax

**URL:** <https://www.ruby-forum.com/t/form-remote-tag-not-providing-params-in-ajax/114230>\
**Category:** Rails\
**Created:** [September 10, 2007, 9:08am UTC](https://www.ruby-forum.com/t/form-remote-tag-not-providing-params-in-ajax/114230 "2007-09-10T09:08:08Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/958977/32.png) [@chris](https://www.ruby-forum.com/u/chris)\
**Post date:** [September 10, 2007, 9:08am UTC](https://www.ruby-forum.com/t/form-remote-tag-not-providing-params-in-ajax/114230/1 "2007-09-10T09:08:08Z")

</div>

I’m new to Ruby, Rails and Ajax and I’m trying to do something  
seemingly simple. I am trying to use a value someone supplies in a  
form in another form that is dynamically generated using Ajax.

I have the following code:

&nbsp;

\<%= form\_remote\_tag(:update =\> “race\_table”, :url =\> { :action =\>  
“update\_races” }) %\>

| Ruleset: | \<%= select(:post, :ruleset, @rulesets) %\> |
| \<%= submit\_tag "Find Races" %\> |

\<%= end\_form\_tag %\>

Which has been changed umpteen times, but this is how it stands now  
and I’m thinking it should be accurate. @rulesets contains an array  
of arrays such that it prints something like Ruleset  
#1

Then I have the update\_races action of the same module. It does  
several things but most notably (and stripped down at the moment it  
does)

@ruleset = params[:ruleset] || 11  
render :layout =\> false

Then I have the update\_races.rhtml file which does lots of things but  
ultimately does:

\<%= @ruleset %\>

And ruleset is ALWAYS 11. For some reason params[:ruleset] is always  
nil. My browser is Firefox 2.0.0.6

Please help 🙂

---

<div class="post-metadata">

**Author:** ![chris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/958977/32.png) [@chris](https://www.ruby-forum.com/u/chris)\
**Post date:** [September 25, 2007, 11:04pm UTC](https://www.ruby-forum.com/t/form-remote-tag-not-providing-params-in-ajax/114230/2 "2007-09-25T23:04:57Z")

</div>

Try params[:post][:ruleset]

If you use select then the first parameter is the object that is being  
worked with and the second parameter is the attribute/method being  
addressed.

What I would suggest you do is put this line of code in your controller  
action

logger.info params.inspect

This will write the contents of params to your development log. Go check  
it  
out - then you can see how params is structured. You will see that  
params in  
a hash, and in params is a “post” =\> {}. The hash that the “post” key  
is  
pointing to will contain the ruleset symbol. so you should see {“post”  
=\>  
{:ruleset =\> 5}, other params go here}

cheers  
Ivor

---

<div class="post-metadata">

**Author:** ![chris](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/958977/32.png) [@chris](https://www.ruby-forum.com/u/chris)\
**Post date:** [September 25, 2007, 11:09pm UTC](https://www.ruby-forum.com/t/form-remote-tag-not-providing-params-in-ajax/114230/3 "2007-09-25T23:09:38Z")

</div>

Thanks so much! Not only did that solve my problem but teaching me  
about the logger will help me immensely to troubleshoot future  
problems 🙂

Chris
