Thanks for the answers,

follow the source web page, I have:

<label for="table_basket">Basket</label>
<select id="table_basket" name="table[basket]"><option value="">Please
select</option>
<option value="1">Awesome</option>
<option value="2">Normal</option></select>

<label for="table_apple">Apple</label>
<select id="table_apple" name="table[apple]"><option value="">Please
select</option>
<option value="1">Green</option>
<option value="1">Red</option>
<option value="2">Yellow</option>
<option value="2">White</option></select>

<input name="commit" type="submit" value="Create Table" />

To works I have to pass the right variable in the follow line

options = $(apple).filter("[label=#{basket}]").html()

I think the problem is here: label=#{basket}] that variable gone be 1 o
2 (check out the option=value in <select id="table_apple"
name="table[apple]"> menu) this value is function of the Basket choice

well I think its only this the problem in the
app/assest/javascript/table.js.coffee file but I don't know if it's only 
a
simple syntax error

jQuery ->
  apple = $('#table_apple').html()
  $('#table_basket').change ->
    basket = $('#table_basket :selected').text()
    options = $(apple).filter("[label=#{basket}]").html()
    if options
      $('#table_apple').html(options)
    else
      $('#table_apple').empty()

thanks a lot anyway

C

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to