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.156 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.155 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.154 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.153 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.152 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.151 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.150 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.149 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.148 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.147 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.146 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.145 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.144 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.143 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.142 app/helpers/ish_manager/application_helper.rb
ish_manager-0.1.8.141 app/helpers/ish_manager/application_helper.rb