Rails 4 with Rspec 3
Configure your Gemfile
# Gemfile group :development, :test do gem 'rspec-rails', '~> 3.0.0' gem 'factory_girl_rails' gem 'capybara'
|_ = require 'underscore'|
|# Given an array of elements ELEM and a matching KEY value,|
|# will build the apprpriate projection to generate sortable|
|# weights for a mongo aggregator.|
|# ELEM: An array of values upon which to match against KEY|
|# KEY: The document field key to match against|
|# I: Default 0, index into array at which to begin|
|expect(@user).to have(1).error_on(:username) # Checks whether there is an error in username|
|expect(@user.errors[:username]).to include("can't be blank") # check for the error message|
A lot of important government documents are created and saved in Microsoft Word (*.docx). But Microsoft Word is a proprietary format, and it's not really useful for presenting documents on the web. So, I wanted to find a way to convert a .docx file into markdown.
On a mac you can use homebrew by running the command
brew install pandoc.
#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