@template can be non-action_view template that doesn't have formats information

This commit is contained in:
Akira Matsuda 2016-11-22 17:06:52 +09:00
parent 1af1f1b963
commit a62bad4b6f
1 changed files with 2 additions and 1 deletions

View File

@ -26,7 +26,8 @@ module Kaminari
end
def to_s(locals = {}) #:nodoc:
@template.render :partial => partial_path, :locals => @options.merge(locals), :formats => @template.formats + [:html]
formats = (@template.respond_to?(:formats) ? @template.formats : Array(@template.params[:format])) + [:html]
@template.render :partial => partial_path, :locals => @options.merge(locals), :formats => formats
end
def page_url_for(page)