This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ be rake routes | grep document | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:10: warning: already initialized constant RUBY | |
/opt/local/lib/ruby1.9/gems/1.9.1/gems/rake-0.9.2/lib/rake/file_utils.rb:84: warning: already initialized constant LN_SUPPORTED | |
documents GET /documents(.:format) {:action=>"index", :controller=>"documents"} | |
POST /documents(.:format) {:action=>"create", :controller=>"documents"} | |
new_document GET /documents/new(.:format) {:action=>"new", :controller=>"documents"} | |
edit_document GET /documents/:id/edit(.:format) {:action=>"edit", :controller=>"documents"} | |
document GET /documents/:id(.:format) {:action=>"show", :controller=>"documents"} | |
PUT /documents/:id(.:format) {:action=>"update", :controller=>"documents"} | |
DELETE /documents/:id(.:format) {:action=>"destroy", :controller=>"documents"} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MyModel < ActiveRecord::Base | |
attr_accessible :some_string | |
acts_as_somethinger :some_string | |
end | |
> a_my_model = MyModel.new | |
> a_my_model.some_string = 'This is a string.' | |
> a_my_model.some_string.do_something | |
"something!" | |
> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Video < ActiveRecord::Base | |
has_many :video_locations | |
has_many :locations, :through => :video_locations | |
accepts_nested_attributes_for :locations | |
has_many :video_people | |
has_many :people, :through => :video_people | |
attr_accessible :title, :date, :url | |
validates_presence_of :title, :date, :url |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Video < ActiveRecord::Base | |
has_many :video_locations | |
has_many :locations, :through => :video_locations | |
accepts_nested_attributes_for :locations | |
def locations_attributes=(attributes) | |
logger.debug "IS THIS EVEN GETTING CALLED!?!??!? Attributes: #{attributes.inspect}" | |
attributes.each do |attr| | |
locations.new(:lat => attr.lat, :lng => attr.lng) | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Video < ActiveRecord::Base | |
has_many :video_locations | |
has_many :locations, :through => :video_locations | |
attr_accessible :title, :date, :url | |
validate :validates_presence_of_locations | |
def validates_presence_of_locations | |
errors.add(:locations, "must have at least one video") if | |
locations.length < 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Fetching source index for http://rubygems.org/ | |
Bundler could not find compatible versions for gem "pg": | |
In Gemfile: | |
repertoire-faceting (~> 0.5.3) depends on | |
pg (~> 0.9.0) | |
activerecord-postgis-adapter depends on | |
pg (0.10.0) |