Skip to content

Commit

Permalink
add photos to venues
Browse files Browse the repository at this point in the history
  • Loading branch information
NeutralAngel committed May 11, 2013
1 parent 148bd67 commit 282f4e5
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 2 deletions.
4 changes: 4 additions & 0 deletions app/assets/stylesheets/events.css.scss
Original file line number Diff line number Diff line change
Expand Up @@ -109,3 +109,7 @@ section.event{
font-weight: normal;
margin-bottom: 5px;
}

#venue_photo img{
border: 1px solid black;
}
2 changes: 1 addition & 1 deletion app/models/venue.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
class Venue < ActiveRecord::Base
attr_accessible :city, :line1, :line2, :name, :state, :zip
attr_accessible :city, :line1, :line2, :name, :state, :zip, :photo_url
has_many :events
end
4 changes: 4 additions & 0 deletions app/views/venues/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@
<%= f.label :zip %><br />
<%= f.text_field :zip %>
</div>
<div class="field">
<%= f.label "Photo URL" %><br />
<%= f.text_field :photo_url %>
</div>
<div class="actions">
<%= f.submit "Submit", class: "venue_submit" %>
</div>
Expand Down
5 changes: 5 additions & 0 deletions app/views/venues/_venue.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
<%= @venue.city %>, <%= @venue.state %> <%= @venue.zip%>
</span>
</p>
<% if @venue.photo_url %>
<div id="venue_photo">
<%= image_tag(@venue.photo_url, :width => '352') %>
</div>
<% end %>
</div>


Expand Down
5 changes: 5 additions & 0 deletions db/migrate/20130204231919_add_photo_to_venues.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class AddPhotoToVenues < ActiveRecord::Migration
def change
add_column :venues, :photo_url, :string
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 => 20121025153533) do
ActiveRecord::Schema.define(:version => 20130204231919) do

create_table "carts", :force => true do |t|
t.datetime "created_at", :null => false
Expand Down Expand Up @@ -70,6 +70,7 @@
t.string "zip"
t.datetime "created_at", :null => false
t.datetime "updated_at", :null => false
t.string "photo_url"
end

end

0 comments on commit 282f4e5

Please sign in to comment.