Tag Archives: Rails

Rails – Find Location using Geocoder

Geocoder is a Rails Gem which helps you to manipulate location in your Rails application. It is written by Alex Reisner. Thanks for his work and you can find out more details at Github – alexreisner / geocoder.

Let’s try it now. Continue reading Rails – Find Location using Geocoder

NERDTree – The File Explorer in vi/vim

I have been working on Rails for more than half year and i do file editing with vi at server side most of the time. vi is a great tool but it is not convenient for editing multiple files which is very common in programmer. In the past, I had to close the file, cd to another directory and opened another file for editing. Continue reading NERDTree – The File Explorer in vi/vim

Rails – RSpec Test with Devise

According to the documentation in the Devise home page, we can use the following before_filter to control the user access on specific controller functions.

before_filter :authenticate_user!

 

But when i try to test the controller function in RSpec, i got the following error.
Failure/Error: post :create
undefined method `authenticate!’ for nil:NilClass
Continue reading Rails – RSpec Test with Devise

Rails – Add Custom Fields to Devise User Model

Previous related posts:

By default, the users table in Devise only contains the email and password fields in user profile. Most likely we need to add our custom fields such that we can store more user information. The following steps show you how to add a username field in the users model. Continue reading Rails – Add Custom Fields to Devise User Model