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:
@@ -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
|
||||
|
@@ -3,8 +3,6 @@
|
||||
%head
|
||||
%meta{'charset' => 'utf-8'}
|
||||
%title scube
|
||||
= stylesheet_link_tag :all
|
||||
= javascript_include_tag :defaults
|
||||
= csrf_meta_tag
|
||||
%body
|
||||
= yield
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user