Skip to content

Instantly share code, notes, and snippets.

View francelwebdev's full-sized avatar

FrancelWebdev francelwebdev

View GitHub Profile

#Simple Authentication with Bcrypt

This tutorial is for adding authentication to a vanilla Ruby on Rails app using Bcrypt and has_secure_password.

The steps below are based on Ryan Bates's approach from Railscast #250 Authentication from Scratch (revised).

You can see the final source code here: repo. I began with a stock rails app using rails new gif_vault

##Steps

"""
- Add some settings -
Log in to your sandbox account and get your API keys plus your merchant ID.
"""
BRAINTREE_PRODUCTION = False # We'll need this later to switch between the sandbox and live account
BRAINTREE_MERCHANT_ID = “your_merchant_id”
BRAINTREE_PUBLIC_KEY = “your_public_key”
BRAINTREE_PRIVATE_KEY = “your_private_key”
@francelwebdev
francelwebdev / How to use Images as Radio buttons.md
Created November 5, 2019 16:34 — forked from rcotrina94/How to use Images as Radio buttons.md
How to use images for radio buttons (input-radio).
<!-- http://bootsnipp.com/snippets/8AGX3 -->
<!-- http://bootsnipp.com/snippets/featured/form-wizard-and-validation -->
<!-- https://www.codeply.com/go/RsUnW5kOcs#! -->
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Dashboard</div>
<div class="panel-body">
HTML
- Semantic HTML
- Event delegation
- Accessibility / ARIA
CSS
- Specificity
- Pseudo-elements
- Pseudo-selectors
- Combinators

Cheat Sheet: Simple Authentication in Rails 6 with has_secure_password

The goal of this cheatsheet is to make it easy to add hand-rolled authentication to any rails app in a series of layers.

First the simplest/core layers, then optional layers depending on which features/functionality you want.

Specs
AUTHOR Ira Herman
LANGUAGE/STACK Ruby on Rails Version 4, 5, or 6