Sha256: deed8c0690b31583b16eea5b83952349533a4c674c66a1cb3cecd9fbc4391ea6

Contents?: true

Size: 490 Bytes

Versions: 10

Compression:

Stored size: 490 Bytes

Contents

module Kaminari
  module Helpers
    class Tag
      def page_url_for(page)
        admin_params = @params.extract!(:admin_params)
        params = @params.merge(@param_name => (page <= 1 ? nil : page), :only_path => true)
        if admin_params.empty?
          @template.url_for params
        else
          symbolized_params = params.inject({}){|memo,(k,v)| memo[k.to_sym] = v; memo}
          Rails.application.routes.url_for(symbolized_params)
        end
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
rademade_admin-0.2.2 config/initializers/kaminari_route_proxy.rb
rademade_admin-0.2.1 config/initializers/kaminari_route_proxy.rb
rademade_admin-0.2.0 config/initializers/kaminari_route_proxy.rb
rademade_admin-0.1.6 config/initializers/kaminari_route_proxy.rb
rademade_admin-0.1.5 config/initializers/kaminari_route_proxy.rb
rademade_admin-0.1.4 config/initializers/kaminari_route_proxy.rb
rademade_admin-0.1.3 config/initializers/kaminari_route_proxy.rb
rademade_admin-0.1.2 config/initializers/kaminari_route_proxy.rb
rademade_admin-0.1.1 config/initializers/kaminari_route_proxy.rb
rademade_admin-0.1.0 config/initializers/kaminari_route_proxy.rb