Sha256: 97119da940ae6ba1fe500ed7171b727239596ace6c2f7151caf1dfbb96a5da3e

Contents?: true

Size: 383 Bytes

Versions: 1

Compression:

Stored size: 383 Bytes

Contents

module AuthorsHelper

  def display_profile_item(item, show_item, item_desc)
    if show_item
      item = link_to(item, item) if is_url?(item)
      content_tag :li do
        "#{item_desc} #{item}"
      end
    end
  end

  def is_url?(str)
    begin
      [URI::HTTP, URI::HTTPS].include?(URI.parse(str.to_s).class)
    rescue URI::InvalidURIError
      false
    end 
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
typo-5.5 app/helpers/authors_helper.rb