Sha256: 12860fc3b9e76cbf6f3ca51cbf11eec470dbf6d985f4fa8ea0efd2a653c5ad3e

Contents?: true

Size: 1.16 KB

Versions: 30

Compression:

Stored size: 1.16 KB

Contents

module Rails
  module Helpers
    module RailsHelper

      def anything_to_html(son,opts={})
        ret = '(RailsHelper :: anything_to_html)' if opts.fetch(:verbose,true) # TODO change dflt to false
        if opts != {}
        ret << "(Options: " + anything_to_html(opts) + ")"
        end
        if son.class == Array
          ret << "<ul class='subtopic' >"
          son.each{|subtopic|
            ret << content_tag(:li, anything_to_html(subtopic).html_safe ) # '- ' + 
          }
          ret << "</ul>"
        elsif son.class == Hash
          #ret << hash_to_html(son)
          ret += '<ul class="maintopic" >'
          son.each{ |k,val|
            ret << content_tag(:li, ( anything_to_html(k) + ' => ' + anything_to_html(val) ).html_safe )
           }
          ret << "</ul>"
        elsif son.class == String
          ret << "<font color='navy' class='ricclass_string' >#{son}</font>"
        elsif son.class == Symbol
          ret << "<i><font color='gray' class='ricclass_symbol' >:#{son}</font></i>"
        else
          ret << "(Unknown Class: #{son.class}) <b>#{son}</b>"
        end
        ret.html_safe
      end
  
  end #/RailsHelper
 end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
ric-0.14.2 lib/rails/helpers/rails_helper.rb
ric-0.14.1 lib/rails/helpers/rails_helper.rb
ric-0.14.0 lib/rails/helpers/rails_helper.rb
ric-0.13.0 lib/rails/helpers/rails_helper.rb
ric-0.12.2 lib/rails/helpers/rails_helper.rb
ric-0.12.0 lib/rails/helpers/rails_helper.rb
ric-0.11.19 lib/rails/helpers/rails_helper.rb
ric-0.11.18 lib/rails/helpers/rails_helper.rb
ric-0.11.16 lib/rails/helpers/rails_helper.rb
ric-0.11.15 lib/rails/helpers/rails_helper.rb
ric-0.11.14 lib/rails/helpers/rails_helper.rb
ric-0.11.13 lib/rails/helpers/rails_helper.rb
ric-0.11.12 lib/rails/helpers/rails_helper.rb
ric-0.11.11 lib/rails/helpers/rails_helper.rb
ric-0.11.10 lib/rails/helpers/rails_helper.rb
ric-0.11.9 lib/rails/helpers/rails_helper.rb
ric-0.11.7 lib/rails/helpers/rails_helper.rb
ric-0.11.6 lib/rails/helpers/rails_helper.rb
ric-0.11.4 lib/rails/helpers/rails_helper.rb
ric-0.11.3 lib/rails/helpers/rails_helper.rb