Ruby on Rails:replace_html不起作用

时间:2010-06-22 19:47:14

标签: ruby-on-rails

所以我有这个div

<div id="result_text"></div>

我尝试做

render :update do |page|
    page.replace_html :result_text, "<div style='font-size:medium;padding-top:25px;'>Thank you. A message has been sent to #{@object.user.name} with your comments.</div>"

我知道该方法正在被调用。但div没有得到新的文本.. = \

1 个答案:

答案 0 :(得分:0)

尝试

page.replace_html 'result_text', "<div style='font-size:medium;padding-top:25px;'>Thank you. A message has been sent to #{@object.user.name} with your comments.</div>"