diff --git a/app/controllers/artists_controller.rb b/app/controllers/artists_controller.rb new file mode 100644 index 0000000..b542d50 --- /dev/null +++ b/app/controllers/artists_controller.rb @@ -0,0 +1,9 @@ +class ArtistsController < ApplicationController + def index + @artists = Artist.all + end + + def show + @artist = Artist.find(params[:id]) + end +end diff --git a/app/controllers/dashboard_controller.rb b/app/controllers/dashboard_controller.rb new file mode 100644 index 0000000..91905ae --- /dev/null +++ b/app/controllers/dashboard_controller.rb @@ -0,0 +1,6 @@ +class DashboardController < ApplicationController + def index + @recent_tracks = Track.order(created_at: :desc).limit(5) + @recent_comments = Comment.order(created_at: :desc).limit(5) + end +end diff --git a/app/controllers/tracks_controller.rb b/app/controllers/tracks_controller.rb new file mode 100644 index 0000000..b1529a3 --- /dev/null +++ b/app/controllers/tracks_controller.rb @@ -0,0 +1,9 @@ +class TracksController < ApplicationController + def index + @tracks = Track.all + end + + def show + @track = Track.find(params[:id]) + end +end diff --git a/app/views/artists/index.html.erb b/app/views/artists/index.html.erb new file mode 100644 index 0000000..cd379a4 --- /dev/null +++ b/app/views/artists/index.html.erb @@ -0,0 +1,9 @@ +

All Artists

+ + \ No newline at end of file diff --git a/app/views/artists/show.html.erb b/app/views/artists/show.html.erb new file mode 100644 index 0000000..35d09fc --- /dev/null +++ b/app/views/artists/show.html.erb @@ -0,0 +1,11 @@ +

<%= @artist.name %>

+ +

Tracks

+ \ No newline at end of file diff --git a/app/views/dashboard/index.html.erb b/app/views/dashboard/index.html.erb new file mode 100644 index 0000000..1d09314 --- /dev/null +++ b/app/views/dashboard/index.html.erb @@ -0,0 +1,23 @@ +

Dashboard

+ +

Recent Tracks

+ + +

Recent Comments

+ \ No newline at end of file diff --git a/app/views/tracks/index.html.erb b/app/views/tracks/index.html.erb new file mode 100644 index 0000000..a2586a8 --- /dev/null +++ b/app/views/tracks/index.html.erb @@ -0,0 +1,11 @@ +

All Tracks

+ + \ No newline at end of file diff --git a/app/views/tracks/show.html.erb b/app/views/tracks/show.html.erb new file mode 100644 index 0000000..52201b4 --- /dev/null +++ b/app/views/tracks/show.html.erb @@ -0,0 +1,27 @@ +

<%= @track.title %>

+

+ Artist: <%= @track.artist.name %>
+ Year: <%= @track.year %>
+ BPM: <%= @track.bpm %> +

+ +

Samples Used

+ + +

Sampled By

+ + +

Comments

+ \ No newline at end of file diff --git a/config/routes.rb b/config/routes.rb index 48254e8..bdd92c0 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,5 +1,9 @@ Rails.application.routes.draw do # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html + resources :artists, only: [ :index, :show ] + resources :tracks, only: [ :index, :show ] + + get "/dashboard", to: "dashboard#index" # Reveal health status on /up that returns 200 if the app boots with no exceptions, otherwise 500. # Can be used by load balancers and uptime monitors to verify that the app is live.