Skip to content

Commit

Permalink
added lastfm_desc column to bands and updated the band/show view
Browse files Browse the repository at this point in the history
  • Loading branch information
te0d committed May 1, 2013
1 parent af54e09 commit 6a5f5c3
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/controllers/bump_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ def new
# parse out band information
lastfmXML.css("similar").remove
band.name = brainzXML.css("name").first.content
band.lastfm_desc = lastfmXML.css("summary").first.content
for image in lastfmXML.css("image")
image_url = image.content if image.attr('size') == 'extralarge'
end
Expand Down
11 changes: 10 additions & 1 deletion app/views/band/show.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
<h1><%= @band.name %></h1>
<div class="page-header">
<h1><%= @band.name %></h1>
</div>

<%= image_tag @band.image.url, :class => "img-polaroid pull-left" %>
<p><em>first bump at <%= @band.created_at %></em></p>
<p><em>by <%= link_to @band.creator.username, user_show_path(@band.creator) %></em></p>

<p><strong>Description:</strong></p>
<p><%= raw @band.lastfm_desc %></p>

<canvas id="bandListensChart" width="800" height="400"></canvas>

Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20130501170358_add_last_fm_desc_to_bands.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddLastFmDescToBands < ActiveRecord::Migration
def change
add_column :bands, :lastfm_desc, :text
end
end
3 changes: 2 additions & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
#
# It's strongly recommended to check this file into your version control system.

ActiveRecord::Schema.define(:version => 20130324232658) do
ActiveRecord::Schema.define(:version => 20130501170358) do

create_table "bands", :force => true do |t|
t.string "mbid"
Expand All @@ -24,6 +24,7 @@
t.integer "image_file_size"
t.datetime "image_updated_at"
t.integer "creator_id"
t.text "lastfm_desc"
end

create_table "bands_users", :force => true do |t|
Expand Down

0 comments on commit 6a5f5c3

Please sign in to comment.