Installing Phantomjs on Linux Mint 16

Just wrote a protip on Coderwall about how to install Phantomjs on Linux Mint 16

Setting Up Spring + RSpec For Testing Your Rails 4 Application

What is spring?

Spring is an application preloader. That means it boots up your rails application and keeps it running in the background.

Why is this good?

It means you don’t have to boot it up every time you need to run a test – shaving a ton of time as you run your tests.

Installation steps

Add to gemfile

1
2
group :development, :test do
3
  gem 'spring-commands-rspec'
4
  gem 'rspec-rails'
5
  gem 'guard-rspec'
6
  gem 'pry'
7
end
8

Note the dependency on spring in spring-commands-rpsec means you don’t need gem “spring”

1
2
bundle install
3
bundle exec spring binstub --all
4
rails g rspec:install
5

Run it

1
2
bin/spring rspec
3
bundle exec guard init rspec
4

Change to the following line in Guardfile:

Change guard :rspec do to:

guard :rspec, cmd:”spring rspec” do

Avoiding the ‘oCol is undefined’ Error with jQuery-datatables-rails

The ‘oCol is undefined’ Error Recently I installed jQuery-datatables-rails in a Rails 4 project. With the Firebug plugin in Firefox, I received an error ‘oCol is undefined’. With Google Chrome via the console, I received an error ‘Cannot

Continue Reading …

Integrating Fat Free CRM Into Your Rails Application

What is Fat FREE CRM? Fat Free CRM is an open-source customer relationship management piece of software that lets you perform the basic marketing activities integral to the sales cycle. Tracking leads, managing campaigns, and contact lists are

Continue Reading …

How to Pass Javascript Functions Without Them Firing

In Javascript, functions are first-class citizens. Implications? This means you can pass functions around in Javascript like they were variables. Here’s some example code to illustrate the concept. //setup prototype function

Continue Reading …

Why You As a Client Want a Rails Codebase With Tests

Would you ever stop changing the oil on your car? I wouldn’t. It’s part of the maintenance that leads to a longer life span for my car and ensures it runs smoothly. In fact, because the automobile industry has done such a good job of educating

Continue Reading …

How to Move One Directory Into Another Directory With Linux and Git

Recently, I was tired and used the Linux mv command and erased a whole bunch of websites when I was SSHing into my web host account. So now I am going to document how to use the mv command just for kicks (and because it’s a short, fun thing to blog

Continue Reading …

Part 5 – Creating, Reading, Updating, and Deleting Tasks

From part 4 of the tutorial, we have set up our polymorphic associations. Now it's time to be able to give users the ability to CRUD (create, read, update, and delete) some tasks.

Continue Reading …

Fixing RSocialize: Where To Put the Custom Options in RSocialize?

I wrote a gem called RSocialize a while ago to help make it easier to install social media buttons on your Rails application.

Continue Reading …

Part 4 – Setting Up a Polymorphic Association Among Users, Folders, Tasks

Part 4 - Setting Up a Polymorphic Association Among Users, Folders, Tasks If you recall the small discussion on polymorphic associations in Part 1a, you'll remember that we wanted the ability to create a task and have the option to not associate it

Continue Reading …