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