Sha256: 2df9f4cb91f7633e543e8f2b63832c556eca5a0e88e30af13859de3b911ee805

Contents?: true

Size: 590 Bytes

Versions: 36

Compression:

Stored size: 590 Bytes

Contents

# This extends the @template.url_for method to work with Kaminari
# It is only extended on the posts#index method, for minimal pollution

module EffectiveKaminariHelper
  def url_for(params)
    if params.kind_of?(Hash) && params[:controller] == 'effective/posts' && params[:action] == 'index'
      params.delete(:page) if params[:page].blank?
      params.delete(:category) if EffectivePosts.use_category_routes
      params = params.except(:action, :controller, :only_path)

      request.path.to_s + (params.present? ? '?' : '') + params.to_param
    else
      super
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
effective_posts-0.7.1 app/helpers/effective_kaminari_helper.rb
effective_posts-0.7.0 app/helpers/effective_kaminari_helper.rb
effective_posts-0.6.4 app/helpers/effective_kaminari_helper.rb
effective_posts-0.6.3 app/helpers/effective_kaminari_helper.rb
effective_posts-0.6.2 app/helpers/effective_kaminari_helper.rb
effective_posts-0.6.1 app/helpers/effective_kaminari_helper.rb
effective_posts-0.6.0 app/helpers/effective_kaminari_helper.rb
effective_posts-0.5.10 app/helpers/effective_kaminari_helper.rb
effective_posts-0.5.8 app/helpers/effective_kaminari_helper.rb
effective_posts-0.5.7 app/helpers/effective_kaminari_helper.rb
effective_posts-0.5.6 app/helpers/effective_kaminari_helper.rb
effective_posts-0.5.5 app/helpers/effective_kaminari_helper.rb
effective_posts-0.5.4 app/helpers/effective_kaminari_helper.rb
effective_posts-0.5.3 app/helpers/effective_kaminari_helper.rb
effective_posts-0.5.2 app/helpers/effective_kaminari_helper.rb
effective_posts-0.5.1 app/helpers/effective_kaminari_helper.rb
effective_posts-0.5.0 app/helpers/effective_kaminari_helper.rb
effective_posts-0.4.7 app/helpers/effective_kaminari_helper.rb
effective_posts-0.4.6 app/helpers/effective_kaminari_helper.rb
effective_posts-0.4.5 app/helpers/effective_kaminari_helper.rb