A question about routing

Hi all,

I have recently bought a site template that I’ve tacked on to my rails
application. The template came with a flash movie that plays at the
top of each page, displaying the site’s name and a few words of the
user’s choosing. The template’s files are stored in the /public
directory as follows:

/public/flash.txt #This is the text displayed in the flash movie
/public/picts/ # a directory where the templates pictures and gif
formatting files are stored
/public/flash/logo.fla
/public/logo.swf
/javascripts/header.js # This script launches the flash movie at the
top of a page

I am using the default routing for the rails application.

If I enter a URL in a browser that matches a controller and gives
no :action or :id parameters then the flash movie works just fine.
For instance: http://www.myapp.com/controller

If I enter anything more explicit than the above (i.e.
http://www.myapp.com/controller/index or
http://myapp.com/controller/list/15)
then the movie will not play. On inspecting the errors in the
development log, I have the following:

Processing LoginController#picts (for 127.0.0.1 at 2007-09-05
16:52:13) [GET]
Session ID: ed449af214e04296229e540d2ae277ae
Parameters: {“format”=>“gif”, “action”=>“picts”, “id”=>“menu”,
“controller”=>“login”}

ActionController::RoutingError (no route found to match “/login/
flash.txt” with {:method=>:get}):

I would appear that the flash movie is requesting files from the
server and that the server is not understanding the requests.

Can anyone point in in the right direction to solving this problem?

Many thanks for any help.
Jim

Jim Welch wrote:

formatting files are stored

ActionController::RoutingError (no route found to match “/login/
flash.txt” with {:method=>:get}):

I would appear that the flash movie is requesting files from the
server and that the server is not understanding the requests.

Can anyone point in in the right direction to solving this problem?

Many thanks for any help.
Jim

We need to see the part of your template where you are embedding the
Flash object. I’m guessing you need to give an absolute path in there
somewhere instead of a relative one.


Michael W.

Hi Michael,

Here is the line in my layout that calls the header javascript file:

But I have aslo tried the following:

<%= javascript_include_tag “header” %>

which gives me exactly the same behaviour.

Here is the code in the header.js file, which is kept in /public/
javascripts/:

Please let me know if there is anything else that you would find
helpful in solving this problem.

Many thanks,
Jim

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs