Forum: Ruby on Rails Flash, Rails, and Routes

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.
0839896be7bca2930a8345b2ee455913?d=identicon&s=25 Doug Pfeffer (Guest)
on 2006-04-19 14:48
Hi all,
I'm working on a Flash app that loads information from Rails, using
Flash's Loadvars() method. This is working great, in all browsers but
Win/IE. I'm wondering if it has to do with some directory/security
sandbox bug in IE's handling of Flash, coupled with Rail's routing.
Below are some examples. Keep in mind that the .swf file is in the
/public directory. The data is coming from the 'get_vars' action in the
'view' controller.

The following Actionscript works in Firefox, Opera, the new IE beta,
etc:
data.load('/view/get_vars', data, 'GET');

And if I set up this route in Rails:
map.connect 'get_vars', :controller => 'view', :action => 'get_vars'

This Actionscript works too:
data.load('/get_vars', data, 'GET');

Neither work in IE6.

However, this does work in IE6:
data.load('/test.php', data, 'GET');
Where test.php is just a PHP script in the /public directory.

Just for kicks, I tried this route:
map.connect 'get_vars.txt', :controller => 'view', :action => 'get_vars'
Thinking that maybe IE/Flash was confused by what could have been a
directory path, but no dice.

Any ideas? Why does a plain text file or PHP file in /public work, but a
seemingly identical route not work?

Thanks!
Doug Pfeffer
0839896be7bca2930a8345b2ee455913?d=identicon&s=25 Doug Pfeffer (Guest)
on 2006-04-20 18:17
For future reference, I solved this issue by writing a gateway script
that went and fetched the proper data. Very hacky.

While the data flow should have been: get_vars ----> Flash
It is now get_vars -----> get_vars.cgi ----> Flash

Lame, but it works.

Doug


Doug Pfeffer wrote:
> Hi all,
> I'm working on a Flash app that loads information from Rails, using
> Flash's Loadvars() method. This is working great, in all browsers but
> Win/IE. I'm wondering if it has to do with some directory/security
> sandbox bug in IE's handling of Flash, coupled with Rail's routing.
> Below are some examples. Keep in mind that the .swf file is in the
> /public directory. The data is coming from the 'get_vars' action in the
> 'view' controller.
>
> The following Actionscript works in Firefox, Opera, the new IE beta,
> etc:
> data.load('/view/get_vars', data, 'GET');
>
> And if I set up this route in Rails:
> map.connect 'get_vars', :controller => 'view', :action => 'get_vars'
>
> This Actionscript works too:
> data.load('/get_vars', data, 'GET');
>
> Neither work in IE6.
>
> However, this does work in IE6:
> data.load('/test.php', data, 'GET');
> Where test.php is just a PHP script in the /public directory.
>
> Just for kicks, I tried this route:
> map.connect 'get_vars.txt', :controller => 'view', :action => 'get_vars'
> Thinking that maybe IE/Flash was confused by what could have been a
> directory path, but no dice.
>
> Any ideas? Why does a plain text file or PHP file in /public work, but a
> seemingly identical route not work?
>
> Thanks!
> Doug Pfeffer
This topic is locked and can not be replied to.