javascript - kaminari paginate via ajax ,remote = true is not affect on view in rails 3 -



javascript - kaminari paginate via ajax ,remote = true is not affect on view in rails 3 -

hello using kaminari gem pagination , want paginatation via ajax .

index.html.haml

#abc = render :partial => 'anything/anything_lists', collection: @anything_upcoming, as: :anything_schedule #paginator = paginate @anything_upcoming, :remote => true, :param_name => "anything_upcoming_page"

index.js.haml

$('#abc').html('#{escape_javascript render(partial: "anything/anything_lists")}'); $('#paginator').html('#{escape_javascript(paginate(@anything_upcoming, :remote => true, :param_name => "anything_upcoming_page").to_s)}');

controller file:

@anything_upcoming = anythingschedule.anything_upcoming.page(params[:anything_upcoming_page]).per(settings.pagination.per_page) respond_to |format| format.js format.html end

view source shows data-remote = true log shows website::eventscontroller#index html. missing here.

edit: doing experiment on js file , convert index.js.haml index.js.erb , 1 time ajax request , shows calling js on logs . , redo 1 time again usual not ajax request .

final edit application.js

//= require jquery //= require jquery_ujs //= require ckeditor-jquery //= require bootstrap.min //= require bootstrap-datepicker.min //= require bootstrap-timepicker.min //= require chosen.jquery.min //= require jquery.popupoverlay //= require mutual //= require ace-elements.min //= require registrations //= require courses //= require instructors //= require jsapi //= require donation //= require workshops //= require nav_settings_dropdown //= require events //= require event_schedules //= require manage_home //= require jquery.blockui //= require rails

gem file

gem 'rails', '3.2.17' gem 'haml' gem 'haml-rails' gem "rails_config", "~> 0.3.3" grouping :assets gem 'sass-rails', '~> 3.2.3' gem 'coffee-rails', '~> 3.2.1' gem 'uglifier', '>= 1.0.3' gem 'jquery-fileupload-rails' gem 'jammit' end gem 'jquery-rails' gem "kaminari", "~> 0.14.1"

you must have forgotten include application.js in layout file

or

you using js or layout default one. please check this

reasone:

the syntax pagination correct

= paginate @anything_upcoming, :remote => true, :param_name => "anything_upcoming_page"

you have included jquery-rails gem , included libraries in application.js

and saying data-remote = true applying element. problem guess left above one.

javascript ajax ruby-on-rails-3 pagination kaminari

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -