I''ve discovered something very odd about the way Rails is handling Flash media. I am attempting to load a partial that contains the code for a flash adverstisment for the website. It was working ok when the code was in the page, but once I pulled it out to a partial (so I could use it on other pages) it stopped working. <%= render(:partial => "shared/dvd_sale_flash_ad") %> I investigated the log and discovered the page was loading, but it for some reason was throwing this when trying to load the Flash media partial. Processing RegistrationController#ads (for 127.0.0.1 at Sat Aug 06 12:08:44 EDT 2005) Parameters: {"action"=>"ads", "id"=>"nhk-468x60.swf", "controller"=>"registration"} ActionController::UnknownAction (No action responded to ads): For some reason. Rails is taking the Flash media code and thinking that it''s another controller/action. This behavior is completely puzzling to me. The only think I can think of is the HTML <param> tags are screwing with Rails logic. Here is the code for the flash ad: ------------------------------------------- <div style="text-align: center; margin-top: 15px;"> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/ swflash.cab#version=6,0,29,0" width="451" height="59"> <param name="movie" value="ads/nhk-468x60.swf"> <param name="quality" value="high"> <embed src="ads/nhk-468x60.swf" quality="high" pluginspage="http:// www.macromedia.com/go/getflashplayer" type="application/x-shockwave- flash" width="451" height="59"></embed> </object> </div> ------------------------------------------- Has anyone come across this before? Is there a work around? Thanks much -Scotty
Perhaps you need to modify your .htaccess file to NOT send requests to your dispatcher for the path "ads"? For what it''s worth, I''m rolling Geoff Stearns'' FlashObject Flash embed method into Rails. I helped rewrite FlashObject for version 1.2 and I think it would be a good addition. On Aug 6, 2005, at 12:20 PM, Scott Doane wrote:> I''ve discovered something very odd about the way Rails is handling > Flash media. I am attempting to load a partial that contains the > code for a flash adverstisment for the website. It was working ok > when the code was in the page, but once I pulled it out to a > partial (so I could use it on other pages) it stopped working. > > <%= render(:partial => "shared/dvd_sale_flash_ad") %> > > I investigated the log and discovered the page was loading, but it > for some reason was throwing this when trying to load the Flash > media partial. > > Processing RegistrationController#ads (for 127.0.0.1 at Sat Aug 06 > 12:08:44 EDT 2005) > Parameters: {"action"=>"ads", "id"=>"nhk-468x60.swf", > "controller"=>"registration"} > ActionController::UnknownAction (No action responded to ads): > > For some reason. Rails is taking the Flash media code and thinking > that it''s another controller/action. This behavior is completely > puzzling to me. The only think I can think of is the HTML <param> > tags are screwing with Rails logic. > > Here is the code for the flash ad: > ------------------------------------------- > <div style="text-align: center; margin-top: 15px;"> > <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" > codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/ > swflash.cab#version=6,0,29,0" width="451" height="59"> > <param name="movie" value="ads/nhk-468x60.swf"> > <param name="quality" value="high"> > <embed src="ads/nhk-468x60.swf" quality="high" > pluginspage="http://www.macromedia.com/go/getflashplayer" > type="application/x-shockwave-flash" width="451" height="59"></embed> > </object> > </div> > ------------------------------------------- > > Has anyone come across this before? Is there a work around? > > Thanks much > > -Scotty > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Yeah, your problem is that the rails routes / dispatcher is not finding the flash file in your public directory because you need to do src="/ads/nhk-468x60.swf" and not src="ads/nhk-468x60.swf" like you had. You should also include the expanded flash syntax which works better across browsers. That said, flash ads are very anoying. With odeo we''ve had a lot of problems where people couldn''t use / see our flash because many people assume all flash are ads and block them. Perhaps you could consider using text ads or something which doesn''t upset your users in the name of making money off of them. -rabble On 8/6/05, Toby Boudreaux <rails-lb8SQxIZKShBDgjK7y7TUQ@public.gmane.org> wrote:> Perhaps you need to modify your .htaccess file to NOT send requests > to your dispatcher for the path "ads"? > > For what it''s worth, I''m rolling Geoff Stearns'' FlashObject Flash > embed method into Rails. I helped rewrite FlashObject for version 1.2 > and I think it would be a good addition. > > > > > > On Aug 6, 2005, at 12:20 PM, Scott Doane wrote: > > > I''ve discovered something very odd about the way Rails is handling > > Flash media. I am attempting to load a partial that contains the > > code for a flash adverstisment for the website. It was working ok > > when the code was in the page, but once I pulled it out to a > > partial (so I could use it on other pages) it stopped working. > > > > <%= render(:partial => "shared/dvd_sale_flash_ad") %> > > > > I investigated the log and discovered the page was loading, but it > > for some reason was throwing this when trying to load the Flash > > media partial. > > > > Processing RegistrationController#ads (for 127.0.0.1 at Sat Aug 06 > > 12:08:44 EDT 2005) > > Parameters: {"action"=>"ads", "id"=>"nhk-468x60.swf", > > "controller"=>"registration"} > > ActionController::UnknownAction (No action responded to ads): > > > > For some reason. Rails is taking the Flash media code and thinking > > that it''s another controller/action. This behavior is completely > > puzzling to me. The only think I can think of is the HTML <param> > > tags are screwing with Rails logic. > > > > Here is the code for the flash ad: > > ------------------------------------------- > > <div style="text-align: center; margin-top: 15px;"> > > <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" > > codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/ > > swflash.cab#version=6,0,29,0" width="451" height="59"> > > <param name="movie" value="ads/nhk-468x60.swf"> > > <param name="quality" value="high"> > > <embed src="ads/nhk-468x60.swf" quality="high" > > pluginspage="http://www.macromedia.com/go/getflashplayer" > > type="application/x-shockwave-flash" width="451" height="59"></embed> > > </object> > > </div> > > ------------------------------------------- > > > > Has anyone come across this before? Is there a work around? > > > > Thanks much > > > > -Scotty > > _______________________________________________ > > Rails mailing list > > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > http://lists.rubyonrails.org/mailman/listinfo/rails > > > > _______________________________________________ > Rails mailing list > Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > http://lists.rubyonrails.org/mailman/listinfo/rails >
Sadly, it''s not my site. I''m the lowly developer grunt who doesn''t have much choice in the matter. We all do what we have to do to keep our houses. I appreciate the advice. I''m away from the dev system at the moment but I''ll try adding the root slash to the file path to see if that fixes the issue. Many Thanks -Scotty On Aug 6, 2005, at 6:46 PM, evan wrote:> Yeah, your problem is that the rails routes / dispatcher is not > finding the flash file in your public directory because you need to do > src="/ads/nhk-468x60.swf" and not src="ads/nhk-468x60.swf" like you > had. > > You should also include the expanded flash syntax which works better > across browsers. > > That said, flash ads are very anoying. With odeo we''ve had a lot of > problems where people couldn''t use / see our flash because many people > assume all flash are ads and block them. Perhaps you could consider > using text ads or something which doesn''t upset your users in the name > of making money off of them. > > -rabble > > On 8/6/05, Toby Boudreaux <rails-lb8SQxIZKShBDgjK7y7TUQ@public.gmane.org> wrote: > >> Perhaps you need to modify your .htaccess file to NOT send requests >> to your dispatcher for the path "ads"? >> >> For what it''s worth, I''m rolling Geoff Stearns'' FlashObject Flash >> embed method into Rails. I helped rewrite FlashObject for version 1.2 >> and I think it would be a good addition. >> >> >> >> >> >> On Aug 6, 2005, at 12:20 PM, Scott Doane wrote: >> >> >>> I''ve discovered something very odd about the way Rails is handling >>> Flash media. I am attempting to load a partial that contains the >>> code for a flash adverstisment for the website. It was working ok >>> when the code was in the page, but once I pulled it out to a >>> partial (so I could use it on other pages) it stopped working. >>> >>> <%= render(:partial => "shared/dvd_sale_flash_ad") %> >>> >>> I investigated the log and discovered the page was loading, but it >>> for some reason was throwing this when trying to load the Flash >>> media partial. >>> >>> Processing RegistrationController#ads (for 127.0.0.1 at Sat Aug 06 >>> 12:08:44 EDT 2005) >>> Parameters: {"action"=>"ads", "id"=>"nhk-468x60.swf", >>> "controller"=>"registration"} >>> ActionController::UnknownAction (No action responded to ads): >>> >>> For some reason. Rails is taking the Flash media code and thinking >>> that it''s another controller/action. This behavior is completely >>> puzzling to me. The only think I can think of is the HTML <param> >>> tags are screwing with Rails logic. >>> >>> Here is the code for the flash ad: >>> ------------------------------------------- >>> <div style="text-align: center; margin-top: 15px;"> >>> <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" >>> codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/ >>> swflash.cab#version=6,0,29,0" width="451" height="59"> >>> <param name="movie" value="ads/nhk-468x60.swf"> >>> <param name="quality" value="high"> >>> <embed src="ads/nhk-468x60.swf" quality="high" >>> pluginspage="http://www.macromedia.com/go/getflashplayer" >>> type="application/x-shockwave-flash" width="451" height="59"></ >>> embed> >>> </object> >>> </div> >>> ------------------------------------------- >>> >>> Has anyone come across this before? Is there a work around? >>> >>> Thanks much >>> >>> -Scotty >>> _______________________________________________ >>> Rails mailing list >>> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >>> http://lists.rubyonrails.org/mailman/listinfo/rails >>> >>> >> >> _______________________________________________ >> Rails mailing list >> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >> http://lists.rubyonrails.org/mailman/listinfo/rails >> >