Forum: Ruby on Rails google adsense breaks render :partial =>

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.
Richard S. (Guest)
on 2009-04-28 04:00
Hey everybody, i've got a control that returns a partial, no biggie.
Except when that partial contains the javascript for my adsense account.
Then the partial renders correctly, and then quickly replaces my page
with nothing by the ad. When i take away my adsense js, everything works
great. Has anyone encountered this before, or know how to get around it?

def submit_remote_form
   render :partial => "my_partial"
end

#views /my_partial

 <% remote_form_for :action => :submit_remote_form do |f| %>
  <%= f.text_field :something %>

<%= f.submit "submit" %>

    <script type="text/javascript"><!--
    google_ad_client = "";
    /* WhySpam Square */
    google_ad_slot = "";
    google_ad_width = 200;
    google_ad_height = 200;
    //-->
    </script>
    <script type="text/javascript"
    src="http://pagead2.googlesyndication.com/pagead/show_a...
    </script>
<% end %>

I know i could get around this by taking out the adsense js, but that
would require "creative" (to say the least) html/css design to get the
same result.
This topic is locked and can not be replied to.