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
require 'htmlentities' | |
class String | |
def plain_text | |
coder = HTMLEntities.new | |
coder.decode(self).gsub(/<\/?[^>]*>/, '') | |
end | |
def html | |
coder = HTMLEntities.new |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<title>popup test</title> | |
<style type="text/css" media="screen"> |
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
has_many :tags_taggings, :as => :taggable, :class_name => 'Tagging', :conditions => "taggings.association = 'tags'", :dependent => :destroy | |
has_many :tags, :class_name => 'Tag', :through => :tags_taggings, :source => :tag | |
has_many :likes_taggings, :as => :taggable, :class_name => 'Tagging', :conditions => "taggings.association = 'likes'", :dependent => :destroy | |
has_many :likes, :class_name => 'Tag', :through => :likes_taggings, :source => :tag | |
define_index do | |
indexes tags(:name), :as => :tags | |
indexes likes(:name), :as => :likes |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<title>test</title> | |
<style type="text/css" media="screen"> |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> | |
<title>test</title> | |
<style type="text/css" media="screen"> |
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
# Shell script for switching between ruby versions | |
# | |
# Hat Tip To | |
# http://www.metaskills.net/2009/1/20/multiruby-the-macports-way-testing-your-rails-apps-with-ruby-1-9 | |
# | |
chruby () { | |
v=`ruby -e "puts RUBY_VERSION.split('.')[0,2].join('.')"` | |
if [ $v = "1.9" ]; then | |
cv="1.8" |
NewerOlder