Drin Drin - 1 year ago 98
Ruby Question

Kaminari syntax error, unexpected '='

I am using Kaminari paginator and I got this error. I followed the instructions 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...

Please take a look at my controller and views
This is my controller

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

if @asset_location.asset_location_type.name == 'unit_section'
redirect_to :action => :edit, :id => params[:id]
# 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)


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

respond_to do |format|

..and this is my view

<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' %>

I don't know what is the problem here. Can you help me guys? Thanks!

Answer Source

Try removing the class from your code like this:

 <%= paginate @asset_locations, :params => { :action => 'show', :id => @asset_location.id }  %>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download