mirror of
https://github.com/kaminari/kaminari.git
synced 2022-11-09 13:44:37 -05:00
parent
23e4737720
commit
e32c61cf6e
2 changed files with 8 additions and 1 deletions
|
@ -24,7 +24,7 @@ module Kaminari
|
|||
@params = @params.to_unsafe_h if @params.respond_to?(:to_unsafe_h)
|
||||
@params = @params.with_indifferent_access
|
||||
@params.except!(*PARAM_KEY_BLACKLIST)
|
||||
@params.reverse_merge! params
|
||||
@params.merge! params
|
||||
end
|
||||
|
||||
def to_s(locals = {}) #:nodoc:
|
||||
|
|
|
@ -28,6 +28,13 @@ if defined?(::Rails::Railtie) && defined?(::ActionView)
|
|||
end
|
||||
end
|
||||
|
||||
test 'allows for overriding params with the :params option' do
|
||||
view.params[:controller], view.params[:action] = 'addresses', 'new'
|
||||
users = User.page(1)
|
||||
|
||||
assert_match '/users?page=2', view.paginate(users, params: { controller: 'users', action: 'index' })
|
||||
end
|
||||
|
||||
test 'accepts :theme option' do
|
||||
users = User.page(1)
|
||||
begin
|
||||
|
|
Loading…
Reference in a new issue