Add track/{new,create} with file upload for the track

This commit is contained in:
Thibault Jouan
2011-07-23 17:55:25 +00:00
parent 34b38b77cf
commit 6af96b0f75
12 changed files with 159 additions and 0 deletions

View File

@@ -3,6 +3,22 @@ class TracksController < ApplicationController
@track = Track.find params[:id]
end
def new
@track = Track.new
end
def create
@track = Track.new(:name => params[:track][:name])
if params[:track][:file]
@track.uploaded_file = params[:track][:file]
end
if @track.save
redirect_to @track
else
render :new
end
end
def stream
end
end