Kaminari 语法错误,意外的“=”

Kaminari syntax error, unexpected '='

我在使用 Kaminari 分页器时遇到了这个错误。我按照说明 here!

SyntaxError (../ruby/2.3.0/gems/kaminari-0.17.0/app/views/kaminari/_paginator.html.erb:1: syntax error, unexpected '='
...buffer = @output_buffer;class = class = local_assigns[:class...
...

请看我的控制器和视图 这是我的控制器

def show
  @asset_location = AssetLocation.find(params[:id])

  if @asset_location.asset_location_type.name == 'unit_section'
    redirect_to :action => :edit, :id => params[:id]
  else
  # paginate sub-locations
  page_num = paginator_page_number(AssetLocation, params[:id])
  per_page = paginator_per_page(AssetLocation, params[:id])

  @asset_locations = @asset_location.sub_locations.page(page_num).per(per_page)

  if @asset_locations.empty? and page_num > 1
    page_num -= 1

    @asset_locations = @asset_location.sub_locations.page(page_num).per(per_page)

  end

  session["asset_location_#{params[:id]}".to_sym][:page] = page_num

  respond_to do |format|
    format.html
    format.js
  end
end

..这是我的观点

<tfoot>
  <tr class="body-bg-color">
    <td colspan="8">
      <!-- pagination component here -->
      <div class="row-fluid row-fluid-no-margin" id="bottom-paginator">
        <%= paginate @asset_locations, :params => { :action => 'show', :id => @asset_location.id }, class: 'pagination pull-right' %>
      </div>
    </td>
  </tr>
</tfoot>

我不知道这里有什么问题。你能帮帮我吗?谢谢!

尝试像这样从您的代码中删除 class:

 <%= paginate @asset_locations, :params => { :action => 'show', :id => @asset_location.id }  %>