Implement tracks/{show,listen}
This commit is contained in:
8
app/controllers/tracks_controller.rb
Normal file
8
app/controllers/tracks_controller.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
class TracksController < ApplicationController
|
||||
def show
|
||||
@track = Track.find params[:id]
|
||||
end
|
||||
|
||||
def stream
|
||||
end
|
||||
end
|
3
app/models/track.rb
Normal file
3
app/models/track.rb
Normal file
@@ -0,0 +1,3 @@
|
||||
class Track < ActiveRecord::Base
|
||||
validates_presence_of :name
|
||||
end
|
3
app/views/tracks/show.html.haml
Normal file
3
app/views/tracks/show.html.haml
Normal file
@@ -0,0 +1,3 @@
|
||||
%h1= @track.name
|
||||
%audio{:src => stream_track_path(@track)}
|
||||
Your browser does not support the audio element
|
Reference in New Issue
Block a user