Sha256: 6f6dd7cd1911d96d0522efc6f8c9fa7c3f633368c27bb7ccbbb907dccde5ad0c

Contents?: true

Size: 1.05 KB

Versions: 118

Compression:

Stored size: 1.05 KB

Contents

module Bhf
  module PagesHelper
    
    def get_value(key, p)
      return unless p.is_a?(Hash)

      return p[key[0]][key[1]] if key.is_a?(Array) && p[key[0]].is_a?(Hash) && p[key[0]][key[1]].is_a?(String) #omg
      
      p[key] if p[key] && p[key].is_a?(String)
    end

    def current_order_path(order_by, platform_name)
      params_platfrom = params[platform_name] ? params[platform_name].clone : {}

      if params_platfrom['order'] == order_by && params_platfrom['direction'] != 'desc'
        params_platfrom['direction'] = 'desc'
      else
        params_platfrom['direction'] = 'asc'
      end

      params_platfrom['order'] = order_by

      url_for platform_name => params_platfrom
    end

    def order_class(order_by, platform_name)
      params_platfrom = params[platform_name] ? params[platform_name] : {}
      return unless params_platfrom['order'] == order_by
      
      params_platfrom['direction'] == 'desc' ? 'sorted desc' : 'sorted asc'
    end
    
    def has_link?(display_type)
      display_type.to_s.include? '_link'
    end

  end
end

Version data entries

118 entries across 118 versions & 1 rubygems

Version Path
bhf-0.8.0 app/helpers/bhf/pages_helper.rb
bhf-0.7.16 app/helpers/bhf/pages_helper.rb
bhf-0.7.15 app/helpers/bhf/pages_helper.rb
bhf-0.7.14 app/helpers/bhf/pages_helper.rb
bhf-0.7.13 app/helpers/bhf/pages_helper.rb
bhf-0.7.12 app/helpers/bhf/pages_helper.rb
bhf-0.7.11 app/helpers/bhf/pages_helper.rb
bhf-0.7.9 app/helpers/bhf/pages_helper.rb
bhf-0.7.8 app/helpers/bhf/pages_helper.rb
bhf-0.7.7 app/helpers/bhf/pages_helper.rb
bhf-0.7.5 app/helpers/bhf/pages_helper.rb
bhf-0.7.4 app/helpers/bhf/pages_helper.rb
bhf-0.7.3 app/helpers/bhf/pages_helper.rb
bhf-0.7.2 app/helpers/bhf/pages_helper.rb
bhf-0.7.1 app/helpers/bhf/pages_helper.rb
bhf-0.7.0.rc3 app/helpers/bhf/pages_helper.rb
bhf-0.7.0.rc2 app/helpers/bhf/pages_helper.rb
bhf-0.7.0.rc1 app/helpers/bhf/pages_helper.rb
bhf-0.6.32 app/helpers/bhf/pages_helper.rb
bhf-0.6.31 app/helpers/bhf/pages_helper.rb