Skip to content

Instantly share code, notes, and snippets.

View arjunvenkat's full-sized avatar

Arjun Venkataswamy arjunvenkat

View GitHub Profile
@arjunvenkat
arjunvenkat / 0_reuse_code.js
Created September 30, 2013 18:38
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@arjunvenkat
arjunvenkat / devise.md
Last active November 20, 2016 19:47 — forked from raghubetina/devise.md

Authentication and Authorization with Devise

We will be using the [Devise gem][2] to help us get started with authentication (are you who you say you are?) and authorization (are you allowed to do/see this?).

Add sign-in/sign-out

  • Add gem 'devise' to your Gemfile and bundle
  • rails g devise:install

Devise will give you some setup instructions. We don't need to worry about most of them, but we do need to set a root URL. Usually, you will point the root URL to the index action of some important resource in your application: In config/routes.rb:

@arjunvenkat
arjunvenkat / carrierwave.md
Last active May 24, 2018 16:11 — forked from raghubetina/carrierwave.md
CarrierWave Cheatsheet

CarrierWave Cheatsheet

The CarrierWave gem provides us with an easy way to allow file uploads through forms.

Installation

In your Gemfile, include

gem 'carrierwave'