Changeset 1344
- Timestamp:
- 08/12/08 19:20:46 (4 months ago)
- Files:
-
- trunk/app/controllers/public_controller.rb (modified) (1 diff)
- trunk/app/helpers/application_helper.rb (modified) (1 diff)
- trunk/app/helpers/rate_helper.rb (added)
- trunk/app/views/public/vote.rjs (added)
- trunk/config/routes.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/app/controllers/public_controller.rb
r1341 r1344 48 48 def robots 49 49 render :text => "Sitemap: #{url_for :controller => :sitemaps, :action => :show, :id => @show.slug, :only_path => false}" 50 end 51 52 def vote 53 @episode = @show.episodes.find(params[:episode_id]) 54 55 if request.post? 56 @episode.rate params[:rating].to_i 57 end 58 59 respond_to do |format| 60 format.html { redirect_to url_for_episode(@episode) } 61 format.js { render :layout => false } 62 end 50 63 end 51 64 trunk/app/helpers/application_helper.rb
r1326 r1344 1 1 # Methods added to this helper will be available to all templates in the application. 2 2 module ApplicationHelper 3 include RateHelper 3 4 4 5 def show_hostname(show) trunk/config/routes.rb
r1317 r1344 12 12 map.connect 'ep/:episode_slug/ecoute/:content_slug', :controller => 'public', :action => 'content' 13 13 map.connect 'ep/:episode_slug/ecouter/:content_slug', :controller => 'public', :action => 'playlist' 14 map.connect 'vote/:episode_id', :controller => 'public', :action => 'vote' 14 15 map.connect 'tags/:search', :controller => 'public', :action => 'tags' 15 16 map.connect 'feed', :controller => 'public', :action => 'feed'
