Skip to content

Instantly share code, notes, and snippets.

View zolzaya's full-sized avatar

Zolzaya Erdenebaatar zolzaya

View GitHub Profile
@zolzaya
zolzaya / kaminari_load_more.md
Last active February 2, 2021 02:01
Most easy "load more" behavior implementation for Kaminari.

In your view:

<%= link_to "Load more", posts_path(@posts, page: @posts.current_page+1), id: "load-more-posts", remote: true %>

In your controller:

respond_to :html, :js, only: [:index]

def index
module Abilities
def self.ability_for(user)
if user.admin?
AdminAbility.new(user)
else user
MemberAbility.new(user)
else
GuestAbility.new
end
end
➜ frontend git:(master) ✗ ember server --proxy=http://127.0.0.1:8080
version: 0.0.39
Proxying to http://127.0.0.1:8080
Livereload server on port 35729
Serving on http://0.0.0.0:4200
frontend/components/gravatar-image.js: line 1, col 16, 'Ember' is not defined.
frontend/components/gravatar-image.js: line 5, col 50, 'md5' is not defined.
2 errors