Update to rails 3.1.0

* Bump rails version to 3.1.0 in Gemfile
* Update config files
* Fix bcrypt monkey patch for specs
* Fix TracksController
* Replace track streaming with track download
* Remove assets from application layout
This commit is contained in:
Thibault Jouan
2011-09-15 00:32:22 +00:00
parent 9a22c4bb94
commit f49a5a3f67
18 changed files with 164 additions and 148 deletions

View File

@@ -10,7 +10,7 @@ class TracksController < ApplicationController
def create
@track = Track.new(:name => params[:track][:name])
if @track.save_with_file(
params[:track][:file].tempfile,
params[:track][:file],
params[:track][:file].content_type
)
redirect_to @track
@@ -19,9 +19,8 @@ class TracksController < ApplicationController
end
end
def stream
def download
track = Track.find params[:id]
self.content_type = track.mime_type
self.response_body = Streamer.new(track.filepath)
send_file track.filepath, :type => track.mime_type
end
end

View File

@@ -3,8 +3,6 @@
%head
%meta{'charset' => 'utf-8'}
%title scube
= stylesheet_link_tag :all
= javascript_include_tag :defaults
= csrf_meta_tag
%body
= yield

View File

@@ -1,3 +1,3 @@
%h1= @track.name
%audio{:src => stream_track_path(@track), :controls => true, :autoplay => true}
%audio{:src => download_track_path(@track), :controls => true, :autoplay => true}
Your browser does not support the audio element