Welcome to Working With Rails

 

Discussion Forums

Discuss all things Ruby on Rails with perhaps the web's most vibrant group of Ruby on Rails enthusiasts.
Subdomain for download link
1 Post
Subdomain for download link

Hi,

I am trying to get asset links to work with subdomains. I am using the code of alonetone (github.com/sudara/alonetone). The reason I wish to use subdomains for downloads is because I wish to use a CDN for the mp3 download and streaming.

I have tried specifying asset_host to cdn.domain but for some reason download links of say musicsite.com/user/track do not get translated to cdn.musicsite.com/filedirectory/file.mp3

The routes.rb file has:

map.resources :users, :controller => :users,

:member => {:attach_pic => :post, :sudo => :any,
:toggle_follow => :any} do |user|
user.resources :source_files, :path_prefix => ':login'
# TODO: Confusing, because Tracks is also a model. Don't confuse this route, this is indeed for the Assets model
user.resources :tracks, :controller => :assets, :member => {:share => :get, :destroy => :any, :stats => :get}, :collection => {:latest => :get, :search => :post, :mass_edit => :get}, :path_prefix => ':login', :member_path => ':login/tracks/:id' do |track|
  track.resources :comments
end

Any ideas? I am very new to Ruby.

Regards,

1 Post
Login to add your message