By default, Devise will redirect you to the root path after sign in. but sometimes we would like to redirect to the previous page where the anonymous user wanna access. This can be done by the following. Continue reading Rails – Redirect Previous Page After Devise Sign In
Tag Archives: Devise
Rails – Devise User Sign In for RSpec
Last time we should you how to create the mock user using the Factory Girl ♥ Rails gem.
Rails – Create Mock Data for RSpec
Recalled that spec file. Continue reading Rails – Devise User Sign In for RSpec
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
Rails – Customize Devise’s Views
Last time we have talked about how to install Devise in Rails.
Rails – Setup Devise for Rails
Now we want to customize the Devise’s views.
Overriding the default Devise’s views is simple and straight forward, what we need to do is just generate those views in our app/views folder by the following single command. Continue reading Rails – Customize Devise’s Views
Rails – Setup Devise for Rails
Devise is a Rails gem which could help you managing the authentication of your Rails project.
This post followed the steps in Railscasts – Introducing Devise. I made my own notes here such that i don’t need to watch the tutorial again. It is highly recommended to go through the video. Continue reading Rails – Setup Devise for Rails