devise

RSpec-2 and Devise

Hi, i create a customized devise registration controller and i want to test it with rspec. I've tried it with a very simple test : it "creates a new parent" do Parent.should receive(:new) post :create end but i get this exception: Failures: 1) Parent::RegistrationsController POST create creates a new parent Failure/Error:...

How to redirect to a specific page on successful sign up using rails devise gem?

How to redirect to a specific page on successful sign up using rails devise gem? ...

Managing User Accounts with Rails 3 and Devise

I have implemented Devise in a Rails 3 application and I need admin users to be able to manage users. Users are not registerable and therefore an admin must create accounts. What would be the best way to go about this? It doesn't seem very DRY to create my own UsersController when Devise already provides Devise::RegistrationController b...

What is the best way to ban/block users with Devise for Rails?

I'm using Devise for authentication in my rails app and I'd like to be able to block certain accounts and prevent users from reregistering with a blocked email. I'm just not sure what the best way is to go about it. My first thought was to override the sessions and registrations controllers to check the model for a user with a blocked ...

no such file to load -- bcrypt_ext (via devise)

I'm using database authentication in devise(current gem) on rails 3 and I get the following error when trying to log in with username/password. no such file to load -- bcrypt_ext This error occurred while loading the following files: bcrypt bcrypt_ext I have previously "Successfully installed bcrypt-ruby-2.1.2" gem. Any ideas...

devise simple registration form

The user fills in the form his email and password. After submiting the form, the user recieves an email, containing a activation link. After clicking on that link, he comes to an form, where he can fill out the rest of his data (login, gender, age and so on...), before he does'nt correctly fills out the form, he is not allowed to log in....

jqTouch form submission issue (rails 3, devise, jquery, jqtouch, ios 4)

I've been playing around with jqTouch to create a mobile version of my Rails app. I use Devise for authentication, but it won't work with jqtouch. It has something to do with jqtouch's "auto-ajax" functionality. I used a "rel=external" attribute on my sign in form to get it to do something at all (before it simply wouldn't do anythin...

Behavior Driven Development using existing software components

I'm currently reading through the beta version of The Rspec Book: http://www.pragprog.com/titles/achbd/the-rspec-book It describes The Behaviour Driven Development Cycle (red, green, refactor) as taking small steps during the development process. This means adding features one at a time. My question is: If I were to describe a single...

how Customice rails Devise gem for Deferent model

I have problem in my application i need to use devise for my application there are different user levels i need to edit User controller in devise plug-in ...

How disable encrypting password in devise?

Hi! How disable encrypting password in devise? ...

RoR, Devise Gem. Welcome email on sign up.

Hey, how can I send welcoming email to user when one just signed up? I'm using Devise gem for authentication, SMTP is already set up; I just need to understand how to extend devise to send emails. NOTE - this is not confirmation email! UPD Solution: class User < ActiveRecord::Base after_create :send_welcome_email private d...

How to show a login modal in Rails if a user tries to access an authorized section

How would you implement a modal window saying "In order you to access this area you have to be logged in.." in combination with a login form below it every time a user tries to access authorized content. I'm using Rails 3, Devise and CanCan. My first thoughts were do put it somewhere in the application_controller.rb: # application_cont...

ActiveRecord won't let me create new rows, but won't tell me what's wrong

I am using Devise with Rails and ActiveRecord. I have a User model with some base information. I also created 2 other descendants to that: Patient and Doctor. My problem is ActiveRecord is not creating new rows at this moment, and I can't figure out what is wrong. It creates rows on other tables of the db, but I don't understand why it's...

"WARNING: Can't mass-assign protected attributes"

I have used RESTful techniques to generate a model (in fact, I am using Devise gem, which does that for me), and I have added new fields called first_name and last_name to the model. Migration went fine. I added attr_accessor :first_name, :last_name to the model and expected it would just work. But when I try to mass-assign new instances...

How do I install / use Devise in Rails 2.3.5?

I have tried to install from the v.1.2.oauth branch of Devise on Github, but I still get an error. How do I install the devise gem on a rails 2.3.5 application? In particular, I want the one that works with omniauth gem install devise -v "1.2" ERROR: Could not find a valid gem 'devise' (= 1.2) in any repository config.gem 'devise'...

Rails Twitter OAuth Strategy with Devise

I have been searching to figure out how exactly to use the oauthable module in the Devise gem for Rails 3. I have come across a couple of questions on here that seem correct, but I was unable to get the implementation working. My end goal is to have both Twitter and Facebook authentication through Devise in my Rails 3 application. Right ...

How to route sign_up in Rails 3 using Devise

I am using Devise for authenticating a Rails application. I am now able to successfully route /users/sign_in and /users/sign_out to /sign_in and /sign_out via this code in routes.rb: devise_for :user, :as => '' How do I map /registration/sign_up to /sign_up? So that sign_in, sign_out, and sign_up all have the same pattern. Note that...

Rails Devise signup form not accepting custom username field

Hello all, I'm trying to add a username to my devise installation, ala the Railscast episode. I've added the field to my user model, but when I attempt to create a new user with a username, the form action keeps trying to pass a null value to my database, which raises an error. Here's the schema for my User model: create_table "users...

How to create different development and production configurations for devise gem in rails 3

How to create different development and production configurations for devise gem in rails 3? ...

Setup Devise to only allow editing of own records?

I've got Devise working in my Rails app but I can't figure out how to now lock it down so a user can only edit their own record in the users table AND in tables belonging to the user. What am I missing here? Is this done in the controller or the model? ...