Forum: Ruby on Rails link_to_remote with Modalbox.show

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
661ae6e97d0e16c2af2aaf7d197e8387?d=identicon&s=25 Sijo k g (sijo)
on 2009-05-06 06:42
Hi
  In helper I have
change_email_link
  html = []
  html << change_email_js(:email => @email)
  html << %{
  <a href="#" onclick="javascript:popup_email();"
style='text-decoration:none;'>edit</a>
  }
  html.join
end
     Now
def change_email_js(options ={})
  %{
  <script>
  popup_email = function() {
  Modalbox.show('#{
    %{
    <div style="padding-left:20px">
   etc......
   #{link_to_remote 'Ok',{},{:class => :new_ui_blue_button}}
  </div>
  }.gsub("\n",'')}', {title:'&nbsp;',width:400, overlayClose:
false,modelPosition:'center',overlayDuration:0.001,slideDownDuration:0.001,slideUpDuration:0.0001});
  }
  </script>
 }
end

       My problem is This does not popup the modalbox. But when I remove
the line
#{link_to_remote 'Ok',{},{:class => :new_ui_blue_button}}   Or change
this link_to_remote to link_to  everything works as expected What might
be the reason
Please help

Thanks in advance
Sijo
This topic is locked and can not be replied to.