Commit 727b548
Changed files (2)
app
models
views
needs
app/models/need.rb
@@ -2,4 +2,6 @@ class Need < ActiveRecord::Base
belongs_to :user
attr_accessible :description, :address, :latitude, :longitude
acts_as_taggable
+ geocoded_by :address
+ after_validation :geocode, :if => :address_changed?
end
app/views/needs/index.html.erb
@@ -18,9 +18,9 @@ $(function() {
</div>
</div>
<div class="control-group">
- <label class="control-label" for="description">location</label>
+ <%= f.label :address, :class => "control-label" %>
<div class="controls">
- <input name="location" type="text" value="" />
+ <%= f.text_field :address %>
</div>
</div>
<div class="control-group">