vpwzpg
Last Updated: February 25, 2016
·
956
· stevennunez
148187 557681800912781 556845050 n

View source in irb

You can view the source of any method written in ruby in Rails Console with:

Post.method(:create).source

=>def create(attributes = nil, options = {}, &block)
    if attributes.is_a?(Array)
      attributes.collect { |attr| create(attr, options, &block) }
    else
      object = new(attributes, options, &block)
      object.save
      object
    end
  end
Say Thanks
Respond