Add track/{new,create} with file upload for the track
This commit is contained in:
@@ -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
|
||||
|
Reference in New Issue
Block a user