Sha256: de2117297fb9813dd9e191cf77972ba8599648f278fbd4ff8cc195f8986f53d7

Contents?: true

Size: 690 Bytes

Versions: 36

Compression:

Stored size: 690 Bytes

Contents

module IshManager
  module ApplicationHelper

    def pretty_date input
      return input.strftime("%Y-%m-%d")
    end

    def pp_errors errors
      return errors
    end

    def user_path user
      if user.class == 'String'
        "/users/#{user}"
      elsif user.class == User
        "/users/#{user.id}"
      elsif user.class == NilClass
        "/users"
      end
    end

    def pretty_date date
      date.to_s[0, 10]
    end

    def resource_path resource
      case resource.class.name
      when 'City'
        city_path( resource.id )
      when 'Event'
        event_path( resource.id )
      when 'Venue'
        venue_path( resource.id )
      end
    end

  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
ish_manager-0.1.8.192 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.188 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.182 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.181 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.180 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.179 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.178 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.177 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.176 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.173 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.172 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.171 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.166 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.165 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.161 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.162 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.160 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.159 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.158 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.157 app/helpers/ish_manager/application_helper.rb