-1
我使用Kaminari paginator,並且出現此錯誤。我按照說明here!Kaminari語法錯誤,意外'='
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>
我不知道是什麼問題在這裏。你能幫助我嗎?謝謝!
謝謝@Sunny。這個對我有用。 – Drin