Rethinking web accounts (using Rails)

Yahoo 99 (Eric)
Sep 18, 2019 · 9 min read
Image for post
Image for post

Implementation using Ruby on Rails

rails g model Site name:string password_digest:string locked:boolean
get  '/:id', to: 'sites#show', as: 'main'
rails g controller Sites show add_password remove_password
rails g model Post body:text site:references
patch   '/:id',   to: 'sites#add_password', as: 'site_pass'
<% if private? %>
... login form ...
<% end %>
rails g controller Sessions create
post   '/unlock',   to: 'sessions#create', as: 'unlock'
<%= render 'posts/new_post' if postable? %>
root 'sites#home'

The Startup

Medium's largest active publication, followed by +683K people. Follow to join our community.

By The Startup

A newsletter that delivers The Startup's most popular stories to your inbox once a month. Take a look

By signing up, you will create a Medium account if you don’t already have one. Review our Privacy Policy for more information about our privacy practices.

Check your inbox
Medium sent you an email at to complete your subscription.

Yahoo 99 (Eric)

Written by

Design/Dev at unfoundedlabs.com, shirst.com, #world

The Startup

Medium's largest active publication, followed by +683K people. Follow to join our community.

Yahoo 99 (Eric)

Written by

Design/Dev at unfoundedlabs.com, shirst.com, #world

The Startup

Medium's largest active publication, followed by +683K people. Follow to join our community.

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch

Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore

Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade

Get the Medium app