Skip to content

Instantly share code, notes, and snippets.

View JPCodes's full-sized avatar
🎯
Focusing

Jim Padilla JPCodes

🎯
Focusing
View GitHub Profile

Deploy Rails 4 app with Dokku on DigitalOcean

Install dokku

First create a Ubuntu 13.04 x64 droplet on DigitalOcean Control Panel

Then ssh with root account, run this in termianl:

$ wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
@JPCodes
JPCodes / gist:0a5201cdcd3f061b9c193d4d66609dde
Created February 7, 2018 00:36 — forked from esbanarango/gist:6629748
HTML <input> required attribute and Rails form with remote true.

<input> with attribute required

This attribute specifies that the user must fill in a value before submitting a form. It cannot be used when the type attribute is hidden, image, or a button type (submit, reset, or button). The :optional and :required CSS pseudo-classes will be applied to the field as appropriate.

How to show a spinner only when the required validations pass? (Without using any validation plugin, only the required attribute).

Form with a required input

= form_for @person, remote: true do |f|
 = f.text_field, :first_name, required: true