-
Notifications
You must be signed in to change notification settings - Fork 0
Some undocumented things for Newbies (like me)
The ‘url’ should be entered including the ‘protocol’ e.g. ‘http://’ ..
so http://www.yoursite.com/files/thefile.mov
_______________________________________
This issue doesn’t have anything to do with Rails routing, but rather how browsers interpret URLs. Whatever you type in the URL for each download when you set up an episode is the URL that gets put in the link. If you view the HTML source in the browser you should see whatever you typed as the link href there.
There are three different ways you can reference URLs in browsers, one is a relative URL: “files/file.mov” which will take the current path and append that URL to it. You’d end up with “http://mstram.webfactional.com/rcasts/episodes/files/test2.mov”. If you start the URL with a slash: ”/files/file.mov” then it will append that to the current domain: “http://mstram.webfactional.com/files/test2.mov”. Finally if you pass the protocol it will reference that exact URL: “http://foo.com/files/file.mov” will be the full link. Again, this isn’t specific to the Rails app, but how browsers interpret link paths. The browser doesn’t know anything about ”/rcasts” as being the Rails root url which is why it doesn’t factor that in.
I always reference the full URL (with the protocol) when creating downloads at railscasts.com. So I type in “http://media.railscasts.com/videos/134_paperclip.mov” into the text field.