Sha256: 9aba1696187054fb03308f300df9b9653190c9151fd6e78f713352cf22bf3bdf

Contents?: true

Size: 608 Bytes

Versions: 1

Compression:

Stored size: 608 Bytes

Contents

module Errdo
  module Helpers
    module ViewsHelper
      def user_show_string(user)
        if user.respond_to?(Errdo.user_string_method || "")
          user.send(Errdo.user_string_method)
        elsif user
          user.class.to_s + " #" + user.id.to_s
        else
          ""
        end
      end

      def user_show_path(user)
        if Errdo.user_show_path && user
          Rails.application.routes.url_helpers.send(Errdo.user_show_path, user)
        else
          errdo.root_path
        end
      end

      def user_show_url(user)
        user_show_path(user)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
errdo-0.11.4 lib/errdo/helpers/views_helper.rb