views:

23

answers:

1

Why does this:

    <%= update_page_tag do |page|
    page["femenino"].hide
  end %>

Generates this?

<script type="text/javascript">
//<![CDATA[
try {
$("femenino").hide();
} catch (e) { alert('RJS error:\n\n' + e.toString()); alert('$(\"femenino\").hide();'); throw e }
//]]>
</script>

I have the DIV with ID "femenino", the update_page_tag is located after the DIV and it works but I dont like to look at that error in the source code.

Thanks

+1  A: 

When the config.action_view.debug_rjs option is enabled, rails will wrap most of the javascript generated from PrototypeHelper in a try/catch block. By default config.action_view.debug_rjs is enabled in development mode only, so check your config/environments/production.rb file if you're seeing this in production.

jdeseno
Ooo thanks, I've only run the app in development so I'll check that when is in production.
miligraf