page.insert_html not rendering partial correctly

Posted by mathee on Stack Overflow See other posts from Stack Overflow or by mathee
Published on 2010-05-26T23:19:48Z Indexed on 2010/05/26 23:21 UTC
Read the original article Hit count: 253

Filed under:
|
|

The following is in the text_field.

= f.text_field :title, :size => 50, :onchange => remote_function(:update => :suggestions, :url => {:action => :display_question_search_results})

The following is in display_questions_search_results.rjs.

page.insert_html :bottom, 'suggestions', :partial => 'suggestions'

Whenever the user types, I'd like to search the database for any tuples that match the keywords in the text field. Then, display those results. But, at the moment, _suggestions.haml only contains the word "suggestions!!".

But, instead of seeing "suggestions!!" in the suggestions div tag, I get:

try { Element.insert("suggestions", { bottom: "suggestions!!" }); } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('Element.insert(\"suggestions\", { bottom: \"suggestions!!\" });'); throw e }

I've been trying to find out why this is being done, but the previously asked questions I found seem more complicated than what I'm doing...

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about partial-views