Changeset 1220
- Timestamp:
- 07/22/08 20:27:20 (4 months ago)
- Files:
-
- trunk/app/helpers/application_helper.rb (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/helpers/application_helper.rb
r1212 r1220 2 2 module ApplicationHelper 3 3 4 def show_hostname(show) 5 hostname = if show.host.nil? 6 "#{show.slug}.bonnes-ondes.fr" 7 else 8 show.host.name 9 end 10 11 hostname + request.port_string 12 end 13 4 14 def url_for_show(show, options = {}) 5 15 options.update({ :controller => "public", :action => "show", 6 : show_slug => show.slug})16 :host => show_hostname(show) }) 7 17 url_for options 8 18 end 9 19 10 20 def url_for_podcast(show) 11 url_for :controller => "public", :action => "feed", : show_slug => show.slug21 url_for :controller => "public", :action => "feed", :host => show_hostname(show) 12 22 end 13 23 14 24 def url_for_episode(episode, options = {}) 15 25 options.update({ :controller => "public", :action => "episode", 16 : show_slug => episode.show.slug,26 :host => show_hostname(episode.show), 17 27 :episode_slug => episode.slug }) 18 28 … … 29 39 30 40 url_for(options.merge({ :controller => "public", :action => mode, 31 : show_slug => content.episode.show.slug,41 :host => show_hostname(content.episode.show), 32 42 :episode_slug => content.episode.slug, :content_slug => content.slug })) 33 43 end
