Skip to content

Commit 82e580e

Browse files
committed
Merge branch 'master' of github.com:cloudyMBC/Learning
2 parents 9d47328 + 3aa42d0 commit 82e580e

3 files changed

Lines changed: 12 additions & 0 deletions

File tree

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
class PlaylistsController < ApplicationController
2+
def show
3+
client = SoundCloud.new(:client_id => '1da3190b0fddf388e8615a72180b3302')
4+
@playlist = client.get("/playlists/#{params[:id]}")
5+
end
6+
end

app/views/playlists/show.html.erb

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
<div>
2+
<h1><%= @playlist.title %></h1>
3+
<iframe width="100%" height="450" scrolling="no" frameborder="no" src="https://w.soundcloud.com/player/?url=https%3A//api.soundcloud.com/playlists/<%= @playlist.id %>&amp;color=ff5500&amp;auto_play=false&amp;hide_related=false&amp;show_comments=true&amp;show_user=true&amp;show_reposts=false"></iframe>
4+
</div>

config/routes.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99

1010
get 'tracks/:id' => 'tracks#show'
1111

12+
get 'playlists/:id' => 'playlists#show'
13+
1214
# Example of regular route:
1315
# get 'products/:id' => 'catalog#view'
1416

0 commit comments

Comments
 (0)