Skip to content

Instantly share code, notes, and snippets.

View akbarb24's full-sized avatar
👻
debugging...

E. Akbar Binaji akbarb24

👻
debugging...
View GitHub Profile
@akbarb24
akbarb24 / kaminari_load_more.md
Created October 23, 2019 02:17 — forked from zolzaya/kaminari_load_more.md
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
@akbarb24
akbarb24 / rails http status codes
Created October 16, 2019 05:05 — forked from mlanett/rails http status codes
HTTP status code symbols for Rails
HTTP status code symbols for Rails
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings.
Status Code Symbol
1xx Informational
100 :continue
101 :switching_protocols
102 :processing
rake db:migrate
/Users/akbarb/Documents/stuffs/my_apps/url_shortener/rails_url_shortener/vendor/bundle/ruby/2.4.0/gems/rake-12.3.2/lib/rake/file_utils.rb:10: warning: already initialized constant FileUtils::RUBY
/Users/akbarb/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rake-12.3.2/lib/rake/file_utils.rb:10: warning: previous definition of RUBY was here
/Users/akbarb/Documents/stuffs/my_apps/url_shortener/rails_url_shortener/vendor/bundle/ruby/2.4.0/gems/rake-12.3.2/lib/rake/file_utils.rb:109: warning: already initialized constant FileUtils::LN_SUPPORTED
/Users/akbarb/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rake-12.3.2/lib/rake/file_utils.rb:109: warning: previous definition of LN_SUPPORTED was here
/Users/akbarb/Documents/stuffs/my_apps/url_shortener/rails_url_shortener/vendor/bundle/ruby/2.4.0/gems/rake-12.3.2/lib/rake/file_utils_ext.rb:17: warning: already initialized constant Rake::FileUtilsExt::DEFAULT
/Users/akbarb/.rbenv/versions/2.4.0/lib/ruby/gems/2.4.0/gems/rake-12.3.2/lib/rake/file_utils_e