I''m using the AJAX helper stuff for the first time to update the contents of a multi-line select-element dynamically. Here''s the template, search.rhtml, that I use for generating the response <% if @hits %> <% @hits.each_with_index do |hit,i| %> <option value="<%= i %>"><%= hit.name %></option> <% end %> <% end %> Konqueror renders the received options correctly, but Firefox apparently strips out the tags and just sets the text between <select></select>. At any rate, what I get to see is a multi-line select box where all text is concatenated in the first line. Is this indeed a problem with Firefox or is there anything I might be doing wrong? Michael -- Michael Schuerig This is not a false alarm mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org This is not a test http://www.schuerig.de/michael/ --Rush, Red Tide
Have you tried putting the select HTML into a template, and re-rendering the entire partial instead? It would certainly clean your code up and simplify the render call from yor Ajax handler. sam On 5/3/05, Michael Schuerig <michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org> wrote:> > I''m using the AJAX helper stuff for the first time to update the > contents of a multi-line select-element dynamically. Here''s the > template, search.rhtml, that I use for generating the response > > <% if @hits %> > <% @hits.each_with_index do |hit,i| %> > <option value="<%= i %>"><%= hit.name %></option> > <% end %> > <% end %> > > Konqueror renders the received options correctly, but Firefox apparently > strips out the tags and just sets the text between <select></select>. > At any rate, what I get to see is a multi-line select box where all > text is concatenated in the first line. > > Is this indeed a problem with Firefox or is there anything I might be > doing wrong? > > Michael > > -- > Michael Schuerig This is not a false alarm > mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org This is not a test > http://www.schuerig.de/michael/ --Rush, Red Tide > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >-- sam http://www.magpiebrain.com/
[using the AJAX helpers to change the contents of a select element] On Tuesday 03 May 2005 18:40, Sam Newman wrote:> Have you tried putting the select HTML into a template, and > re-rendering the entire partial instead? It would certainly clean > your code up and simplify the render call from yor Ajax handler.I''m currently in a phase of getting acquainted with AJAX and not yet overly concerned with cleanliness. First I''d like to get an idea of how things work at all. Anyway, thanks for the suggestion, it appears to work now. Michael -- Michael Schuerig Airtight arguments have mailto:michael-q5aiKMLteq4b1SvskN2V4Q@public.gmane.org vacuous conclusions. http://www.schuerig.de/michael/ --A.O. Rorty, Explaining Emotions