Flowdock
method

new

Importance_1
v3.2.13 - Show latest stable - 0 notes - Class: ActiveResource::Base
new(attributes = {}, persisted = false) public

Constructor method for new resources; the optional attributes parameter takes a hash of attributes for the new resource.

Examples

my_course = Course.new
my_course.name = "Western Civilization"
my_course.lecturer = "Don Trotter"
my_course.save

my_other_course = Course.new(:name => "Philosophy: Reason and Being", :lecturer => "Ralph Cling")
my_other_course.save
Show source
Register or log in to add new notes.