Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3952356
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:50:27+00:00 2026-05-20T01:50:27+00:00

So I have a helper that I’m using to swap my header image for

  • 0

So I have a helper that I’m using to swap my header image for another image that seems to work fine. This is my helper.

def header_image_tag
  @header_image ||= 'headers/image.png'
  image_tag @header_image
end

def header_image(image_path)
  @header_image = image_path
end

And in my View I use.

<% header_image('headers/newimage.png') %>

Now here is the tricky part, what I’d like to do, is instead of replacing it with a picture I’d like to swap in a flash banner.

I tried to do it by swapping in code instead using sanitize (which works just not using object tags). Below is first my helper for this…

def text_banner_tag
  @text_banner ||= 'textBanner.png'
  if @text_banner != "textBanner.png"
  else
    image_tag @text_banner
  end
end

def text_banner(object_code)
  @text_banner = object_code
end

and the code in my view…

<% text_banner(sanitize('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="970" height="48" id="FlashID" title="textbanner" alt="text banner">
      <param name="movie" value="/flash/textbanner.swf">
      <param name="quality" value="high">
      <param name="wmode" value="transparent">
      <param name="swfversion" value="6.0.65.0">
      <!-- Next object tag is for non-IE browsers. So hide it from IE using IECC. -->
      <!--[if !IE]>-->
      <object type="application/x-shockwave-flash" data="/flash/textbanner.swf" width="970" height="48">
        <!--<![endif]-->
        <param name="quality" value="high">
        <param name="wmode" value="transparent">
        <param name="swfversion" value="6.0.65.0">
        <param name="expressinstall" value="/Scripts/expressInstall.swf">
        <!-- The browser displays the following alternative content for users with Flash Player 6.0 and older. -->
        <div>
          <%= image_tag("textBanner.png", :size => "970x48", :alt => "text banner", :border => "0") %>
        </div>
        <!--[if !IE]>-->
      </object>
      <!--<![endif]-->
    </object>')) %>

Any and all help would be greatly appreciated!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T01:50:28+00:00Added an answer on May 20, 2026 at 1:50 am

    In doing some digging around, for those that might come across this in the future and want to implement it on their own site, this is what I found and works great.

    Basically you need to ad a set of tags and a set of attributes to the sanitize as sanitize only uses basic html its missing things like which are much needed elements for flash.

    Here’s what I did in the helper:

      def text_banner_tag
        @text_banner ||= '<img src="/images/textBanner.png">'
          tags = %w(a acronym b strong i img em li ul ol h1 h2 h3 h4 h5 h6 object param div blockquote br cite sub sup ins p)
          sanitize(@text_banner, :tags => tags, :attributes => %w(href classid title width height id alt data name value src))
      end
    
      def text_banner(object_code)
        @text_banner = object_code
      end
    

    In the layout you call the banner using:

    <%= text_banner_tag %>
    

    And in the view that you’d like to display the flash banner for you add this to the top of the view:

    <% text_banner('<object> <param> <div>text for no flash</div> </object>') %>
    

    be sure to fill in everything you need for the flash object.

    You can also use this to implement lots of other extras

    Security Warning just be careful if your handing this usage out to users that are filling in forms that allow for code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a rails helper in my application_helper.rb file that looks like this: def
I have this helper that I am building: def myhelper(object, attributes = []) attributes.each
I have an HTML helper that I need to pass an Object to. This
I have a helper inside a partial that I am loading something like this:
I have a helper method that creates navigation links for some controllers. def gen_associations(controllers)
I have this helper method that I can't seem to clean up with content_tag
I have a problem with the Form Helper that returned $this->data keeps being empty.
I have a custom Action Helper that is working fine. It's generating a dynamic
Suppose I have a static helper class that I'm using a lot in a
I have a markdown helper that looks like this in application_helper.rb . How would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.