HELP!
Ruby
code posted
by
Fayimora
created at 01 Feb 14:03
Edit
|
Back
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
#application_helper.rb def coderay(text) text.gsub(/\<code( lang="(.+?)")?\>(.+?)\<\/code\>/m) do content_tag("notextile", CodeRay.scan($3, $2).div(:css => :class)) # CodeRay.scan($3, $2).div(:css => :class) end #show.html.erb textilize(coderay(@post.body)) #gemfile gem 'coderay' gem 'RedCloth' #this is what i posted These vibrations are transmitted through a bridge to a soundboard that amplifies them. * item * item 2 <code lang="ruby"> def hello puts 'Hello, world!' end </code> |
541 Bytes in 3 ms with coderay