diff --git a/lib/kaminari/helpers/paginator.rb b/lib/kaminari/helpers/paginator.rb index 1d75143..bc0ba9a 100644 --- a/lib/kaminari/helpers/paginator.rb +++ b/lib/kaminari/helpers/paginator.rb @@ -26,7 +26,7 @@ module Kaminari end @template, @options = template, options @theme = @options.delete(:theme) - @views_prefix = @options.delete(:views_prefix) + @views_prefix = @options[:views_prefix] @window_options.merge! @options @window_options[:current_page] = @options[:current_page] = PageProxy.new(@window_options, @options[:current_page], nil) diff --git a/lib/kaminari/helpers/tags.rb b/lib/kaminari/helpers/tags.rb index 9e27b8c..e312799 100644 --- a/lib/kaminari/helpers/tags.rb +++ b/lib/kaminari/helpers/tags.rb @@ -19,7 +19,7 @@ module Kaminari @template, @options = template, options.dup @param_name = @options.delete(:param_name) || Kaminari.config.param_name @theme = @options.delete(:theme) - @views_prefix = @options.delete(:views_prefix) + @views_prefix = @options[:views_prefix] @params = template.params.except(*PARAM_KEY_BLACKLIST).merge(@options.delete(:params) || {}) end diff --git a/spec/fake_app/views/alternative/kaminari/_first_page.html.erb b/spec/fake_app/views/alternative/kaminari/_first_page.html.erb new file mode 100644 index 0000000..124343a --- /dev/null +++ b/spec/fake_app/views/alternative/kaminari/_first_page.html.erb @@ -0,0 +1 @@ +<%= current_page %> \ No newline at end of file diff --git a/spec/fake_app/views/alternative/kaminari/_paginator.html.erb b/spec/fake_app/views/alternative/kaminari/_paginator.html.erb index 205684e..8d6cbec 100644 --- a/spec/fake_app/views/alternative/kaminari/_paginator.html.erb +++ b/spec/fake_app/views/alternative/kaminari/_paginator.html.erb @@ -1 +1,3 @@ -

<%= current_page %>

\ No newline at end of file +<%= paginator.render do -%> + <%= first_page_tag %> +<% end -%> diff --git a/spec/helpers/action_view_extension_spec.rb b/spec/helpers/action_view_extension_spec.rb index 99ab041..0612b8b 100644 --- a/spec/helpers/action_view_extension_spec.rb +++ b/spec/helpers/action_view_extension_spec.rb @@ -18,8 +18,8 @@ describe 'Kaminari::ActionViewExtension', :if => defined?(Rails) do context 'accepts :view_prefix option' do before { helper.controller.append_view_path "spec/fake_app/views" } - subject { helper.paginate @users, :views_prefix => "alternative/" } - it { should eq("

1

") } + subject { helper.paginate @users, :views_prefix => "alternative/", :params => {:controller => 'users', :action => 'index'} } + it { should eq(" 1\n") } end end