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
def highlight(document) | |
document.gsub(%r{<pre><code>(.*?)</code></pre>}m) do |match| | |
Uv.parse($1, 'xhtml', 'ruby', false, 'twilight') | |
end | |
end |
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
# demo of adding a CSV description to any arbitrary object using the 'comma' gem | |
# | |
# http://github.com/crafterm/comma for more info | |
class Book < ActiveRecord::Base | |
# ================ | |
# = Associations = | |
# ================ | |
has_many :pages |
NewerOlder