1
以下内容位于text_field中。page.insert_html不能正确呈现部分
= f.text_field :title, :size => 50, :onchange => remote_function(:update => :suggestions, :url => {:action => :display_question_search_results})
以下内容位于display_questions_search_results.rjs中。
page.insert_html :bottom, 'suggestions', :partial => 'suggestions'
无论何时用户键入,我想在数据库中搜索与文本字段中的关键字匹配的任何元组。然后,显示这些结果。但是,目前,_suggestions.haml只包含单词“suggestions !!”。
但是,并没有看到“建议!!”在suggestions
div标签,我得到:
try { Element.insert("suggestions", { bottom: "suggestions!!" }); } catch (e) { alert('RJS error:\n\n' + e.toString()); alert('Element.insert(\"suggestions\", { bottom: \"suggestions!!\" });'); throw e }
我一直在试图找出为什么这个正在做,但以前提出的问题,我发现似乎比我在做什么更复杂......