Checking content_for

killthekitten Feb 22, 2013

There's a much simpler way to check if content exists or not, and it's been provided as example in docs since 05.2010:

module StorageHelper
def stored_content
  content_for(:storage) || "Your storage is empty"
end
end

But this behavior was broken with SafeBuffer. You'll be able...

Other Example

jackson_pires Feb 2, 2013
##

class Exam cattr_reader :code, :description, :points, :instance_reader => false

@@code = "EXM"
@@description = "Sent Exam"
@@points = 1000

end

=== In this case it's possible to use

Exam.code # => EXM Exam.description # => Sent Exam Exam.points # => 1000

Use sqlite3, not sqlite

Ajedi32 Jan 26, 2013

Note that typically if you want to connect to an SQLite database the adapter would be "sqlite3"; not "sqlite" as depicted in the documentation above. Just using the term "sqlite" might result in the error message: "database configuration specifies nonexistent sqlite adapter"