Rails

Simpler Handling of AJAX Form Errors in Rails 4
Thu, Aug 18, 2016 - ~1500 Words
The Problem With unobtrusive Javascript, converting a form in Rails to use AJAX is as easy as setting remote: true: = form_for Client.new, remote: true do |form| = form.text_field :name This will cause our form to submit asynchronously, and expect a Javascript response, which will be executed directly to e.g. update the page appropriately. DHH recommends that we design our apps in this manner, where in the Javascript response we re-render the model using its template and use jQuery to update the HTML on the page.
Read more →
Reinstalling MySQL on OSX using Homebrew
Thu, Jan 28, 2016 - ~300 Words
If you find that you need to have a particular version of MySQL installed on your OSX machine (e.g. to match the version running in production) but you already have a different version of MySQL installed via Homebrew, then the notes below may help you to replace the installed version with the one you need. DISCLAIMER: The following instructions involve the complete removal of the existing MySQL installation, including any databases.
Read more →
Robust Integration Testing in Rails 4 with RSpec, Capybara and Selenium
Wed, Aug 20, 2014 - ~2900 Words
The Problem Using RSpec and Capybara to test your Rails apps can make writing tests easier which is good both from a perspective of getting people to actually write tests but also for our general productivity as developers. While it has its detractors, I like the terse syntax and ease with which we can define our own helpers which help set up certain contexts such as in this case setting up the default account and switching into its subdomain:
Read more →