Flowdock
method

notestuff

Importance_0
v3.0.9 - Show latest stable - 0 notes - Class: RailsGuides::TextileExtensions
notestuff(body) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File railties/guides/rails_guides/textile_extensions.rb, line 3
    def notestuff(body)
      body.gsub!(/^(IMPORTANT|CAUTION|WARNING|NOTE|INFO)[.:](.*)$/) do |m|
        css_class = $1.downcase
        css_class = 'warning' if ['caution', 'important'].include?(css_class)

        result = "<div class='#{css_class}'><p>"
        result << $2.strip
        result << '</p></div>'
        result
      end
    end
Register or log in to add new notes.