On Aug 12, 2:24 pm, Pete Moran <rails-mailing-l...@andreas-s.net>
wrote:
>
> <h1>Listing countries</h1>
> <div id="mytable">
> <table border="1">
>   <tr>
>     <td>Please select country</td>
>     <td><%= select_tag(:id ,
> options_from_collection_for_select(@countries, :id, :country)) %></td>
>   </tr>
>   <tr>
>     <div id="show_cities"></div>
>   </tr>
> </table>
> </div>

Browsers are often a bit finnicky about inserting stuff into tables.
Strictly speaking you shouldn't have a div there - a tr should contain
td tags and things like that. In the past I've also found that
inserting a tbody with some rows to work better than just inserting
rows.

Fred

> <%= observe_field :id, :frequency => 0.25, :url =>  {:controller =>
> "countries", :action => 'show'}, :with => 'id' %>
>
> So when the user chooses a country it gets all the cities of that
> country, now all I want to do is add a new row to the existing table,
> with a new select containing the cities.  My show.rjs does
>
> page.replace_html :show_cities, :partial => 'show', :object => @country
>
> And then the partial is
>
> <td>Please select city</td>
>     <td><%= select_tag(:id ,
> options_from_collection_for_select(@country.cities, :id, :title))
> %></td>
>
> And it displays the data, but not in the exiting table...I know this
> probably isn't strictly rails as its javascript/html but maybe someone
> can help... All I want is to be able to add new rows when the data is
> available?
> --
> Posted viahttp://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