Infinite Scrolling
https://www.bearer.com/blog/infinite-scrolling-pagination-hotwire
Rails take the controller name and devise/sessions, devise/registrations etc inherit from the controller Devise. That way you can just stick with devise.html.erb as layout for every controller inside devise.
You can test that behaviour and create layout layouts/posts.html.erb and you will see that every action inside posts_controller will be using that as far as you will be not changing that :)
application_controller is the reason why application layout is default when you are not using some from inherited controller names.
1) Setup Server on Vultr | |
Select “create New Server(e.g. 123.123.123.123)”, select “Ubuntu 14.04 LTS” | |
Once your server has been created, wait for installation to complete. | |
SSH into your Server as root and run the following commands: | |
# login server by SSH | |
ssh root@dokku.me | |
# Updating apt-get | |
sudo apt-get update # Fetches the list of available updates | |
sudo apt-get upgrade # Strictly upgrades the current packages | |
sudo apt-get dist-upgrade # Installs updates (new ones) |
<?php | |
// via http://wordpress.stackexchange.com/questions/17325/how-to-enable-hierarchical-permalinks-for-hierarchical-taxonomies | |
// and http://wordpress.org/support/topic/hierarchical-custom-taxonomy-permalinks | |
register_taxonomy('genre',array('book'), array( | |
'hierarchical' => true, // this makes it hierarchical in the UI | |
'labels' => $labels, | |
'show_ui' => true, | |
'query_var' => true, | |
'rewrite' => array( 'hierarchical' => true ), // this makes hierarchical URLs |
#!/usr/bin/env bash | |
# for debug output, uncomment: | |
#set -x | |
function help { | |
echo "WordPress cleanup -v 0.5 2018-06-26 / peeter@zone.ee | |
Usage: |
require 'nokogiri' | |
require 'open-uri' | |
# Get a Nokogiri::HTML:Document for the page we're interested in... | |
doc = Nokogiri::HTML(open('http://www.google.com/search?q=tenderlove')) | |
# Do funky things with it using Nokogiri::XML::Node methods... | |
#### |
ActiveRecord::Base.connection.reset_pk_sequence!('table_name') |
# Based on: http://donpottinger.net/blog/2014/11/17/bye-bye-heroku-hello-dokku.html | |
# Add to gemfile: | |
ruby '2.1.2' | |
gem 'pg' | |
gem 'puma' | |
gem 'rails_12factor' | |
gem 'searchkick' | |
gem 'typhoeus' |