28
Jul 13

Refactoring Flash Message & Writing Helpers

In rails flash provides a way to pass temporary objects between actions. Anything you place in the flash will be exposed to the very next action and then cleared. It is used for showing notices and alerts e.g flash[:notice] = “Post successfully created” I will be editing the blackbook demo app’s flash message, so that [...]


28
Jul 13

Test driven development with rails

As a real fan of test driven development (TDD) I was interested in finding out how rails takes care of testing within its applications. In this section, I will be writing test to cover validations. Still working with my blackbook demo app, I wanted to test that user cannot save record without supplying first_name, last_name [...]


17
Jul 13

Creating Model Relationships Ruby on Rails style

After creating an association between statuses and users table by adding user_id to statuses table to indicate that that a user can own many statuses. I then needed to update both user and status models to allow for this relationship to persist. In this blog I will explain how I achieved this using rails, as [...]


17
Jul 13

Installing rails Form Helper – Simple Form

In previous frameworks I have worked with such as cakePHP, there is usually a form helper which exists to help reduce repetitive html tags as well as making it easy to put together fields and validation rules in a single line. I found this is not an exception in rails, but the added advantage that [...]