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
// ---------------------------------------------------------------------------- | |
// markItUp! | |
// ---------------------------------------------------------------------------- | |
// Copyright (C) 2008 Jay Salvat | |
// http://markitup.jaysalvat.com/ | |
// ---------------------------------------------------------------------------- | |
// Html tags | |
// http://en.wikipedia.org/wiki/html | |
// ---------------------------------------------------------------------------- | |
// Basic set. Feel free to add more tags |
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
# == Schema Information | |
# | |
# Table name: posts | |
# | |
# id :integer(4) not null, primary key | |
# title :string(255) | |
# author :text | |
# content :text | |
# state :text | |
# type :text |
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
# credit goes to http://stackoverflow.com/questions/265725/what-is-the-best-way-to-handle-constants-in-ruby-when-using-rails | |
class Enumeration | |
def self.def_enum(key,value) | |
@hash ||= Hash.new { |hash, key| raise NameError, "#{self.name}::#{key} is not defined" } | |
@hash[key] = value | |
end | |
def self.const_missing(key) | |
@hash[key] | |
end |