def self.method_name
end
defines a class method.
def method_name
end
defines an instance method.
This is a pretty good post on it.
More Related Contents:
- Boolean Validation
- How do I get the current absolute URL in Ruby on Rails?
- SSL Error When installing rubygems, Unable to pull data from ‘https://rubygems.org/
- What is the easiest way to duplicate an activerecord record?
- redirect_to using POST in rails
- How to solve error “Missing `secret_key_base` for ‘production’ environment” (Rails 4.1)
- How can I avoid running ActiveRecord callbacks?
- ActiveRecord.find(array_of_ids), preserving order
- In Ruby on Rails, how do I format a date with the “th” suffix, as in, “Sun Oct 5th”?
- How does instance_eval work and why does DHH hate it?
- Is there a clean way to avoid calling a method on nil in a nested params hash? [duplicate]
- What’s the best way to use SOAP with Ruby?
- Ruby 2.4 and Rails 4 stack level too deep (SystemStackError)
- Custom authentication strategy for devise
- Rails: ActiveRecord query based on association value
- Using Process.spawn as a replacement for Process.fork
- Rails 3, has_one / has_many with lambda condition
- How can I find out the current route in Rails?
- Rails 4: assets not loading in production
- Pass a variable into a partial, rails 3?
- Using send_file to download a file from Amazon S3?
- How to use ActiveRecord in a ruby script outside Rails?
- Overriding a module method from a gem in Rails
- Uniq by object attribute in Ruby
- Controller spec unknown keyword: id
- Rails each loop insert tag every 6 items?
- Validation failed: Upload file has an extension that does not match its contents
- unable to install pg gem
- Rails 3 invalid multibyte char (US-ASCII)
- How do I remove lines of data in the middle of a text file with Ruby