devise

Devise Rspec registration controller test failing on update as if it was trying to confirm email address

不羁的心 提交于 2019-12-23 09:22:23
问题 I have the following route: devise_for :users, :controllers => { :omniauth_callbacks => "users/omniauth_callbacks", :registrations => 'users/registrations', :sessions => "users/sessions" } and the following controller test (registrations_controller_spec.rb): require File.dirname(__FILE__) + '/../spec_helper' describe Users::RegistrationsController do include Devise::TestHelpers fixtures :all render_views before(:each) do @request.env["devise.mapping"] = Devise.mappings[:user] end describe

Rails 3.1 Devise How To Change Flash Message CSS From notice to success?

跟風遠走 提交于 2019-12-23 09:21:10
问题 Rails 3.1 and Devise 1.5 question. I'm using the following code to display flash messages in my layout: <% flash.each do |key, message| %> <%= content_tag(:div, message, :class => "flash #{key}") %> <% end %> I'd like to change the css class for some of my confirmation messages from notice to success, but I don't know where to override or change the key because I don't know where it's set. Can anybody point me in the right direction? Thanks! 回答1: So the way to do this is to edit the devise

uninitialized constant devise::controllers::internalhelpers

做~自己de王妃 提交于 2019-12-23 08:52:17
问题 I'm new to rails and currently working on authentication using devise gem. I would like to communicate with my server from my mobile app. So I'm sending data via JSON. When I tried to sign in it shows me the below error: ActionController::RoutingError (uninitialized constant Devise::Controllers::InternalHelpers): app/controllers/session_controller.rb:4:in `<class:SessionController>' app/controllers/session_controller.rb:1:in `<top (required)>' When I was using devise gem version 1.4.6, it was

Rails & Devise: devise specific columns not showing up in rails console

天大地大妈咪最大 提交于 2019-12-23 08:37:38
问题 I am trying to use Devise on my User model but when I go into rails console and try User.new I only get: irb(main):002:0> User.new => #<User id: nil, first_name: nil, last_name: nil, email: nil, created_at: nil, updated_at: nil> Why are the devise columns not showing up? CreateUsers migration: class CreateUsers < ActiveRecord::Migration def change create_table :users do |t| t.string :first_name t.string :last_name t.string :email t.timestamps null: false end end end AddDeviseToUsers migration

How do I test mandrill api with rspec

我只是一个虾纸丫 提交于 2019-12-23 08:30:06
问题 So my client has reported that many of the emails are going to the wrong person, and I would like to write some feature tests to find and make sure that they are receiving the email and what it says in my specs. I have mandrill_mailer which uses mandril api, and before it sends out I would like to see what the message is. For example. Create a new user account -> creates the user, and then sends out a welcome email. in devise it calls RegistrationMailer.new_registration(resource).deliver

How do I test mandrill api with rspec

拜拜、爱过 提交于 2019-12-23 08:30:04
问题 So my client has reported that many of the emails are going to the wrong person, and I would like to write some feature tests to find and make sure that they are receiving the email and what it says in my specs. I have mandrill_mailer which uses mandril api, and before it sends out I would like to see what the message is. For example. Create a new user account -> creates the user, and then sends out a welcome email. in devise it calls RegistrationMailer.new_registration(resource).deliver

I am using Devise, the password change is redirecting to home page, how to keep it on /users/edit?

霸气de小男生 提交于 2019-12-23 08:25:09
问题 I am using devise and the views file is /devise/registrations/edit.html.erb (I have not made any changes to it): <div><%= f.label :password %> <%= f.password_field :password, :autocomplete => "off" %></div> <div><%= f.label :password_confirmation %> <%= f.password_field :password_confirmation %></div> <% if f.object.encrypted_password.present? %> <div><%= f.label :current_password %> <i>(we need your current password to confirm your changes)</i><br /> <%= f.password_field :current_password %>

Rails 4, Devise & Mandrill emails

匆匆过客 提交于 2019-12-23 07:47:06
问题 I'm trying to make an app in Rails 4. For the past 3 years, I've been struggling to figure out devise/omniauth (I am still trying to get it to work). Stepping aside from the main problems while I try and find the will to live through this, I've tried to setup emails with Mandrill. I found this tutorial, which I am trying to follow along: https://nvisium.com/blog/2014/10/08/mandrill-devise-and-mailchimp-templates/ I have a mailer called mandrill_devise_mailer.rb class MandrillDeviseMailer <

Remove password confirmation; devise

落爺英雄遲暮 提交于 2019-12-23 07:39:20
问题 I am using devise for authentication in my Rails 3.2.6 app. I had password confirmation first but now I want to remove it. How to go about that? 回答1: You just need to remove the password_confirmation field from your form. More info in this answer. 来源: https://stackoverflow.com/questions/11641901/remove-password-confirmation-devise

“Missing host to link to!” for Devise

社会主义新天地 提交于 2019-12-23 07:03:32
问题 I installed Devise and things seem to stop up whenever I try to create an account. The full error reads: Missing host to link to! Please provide :host parameter or set default_url_options[:host] I've got the following code sitting in inside the development.rb block. I've tried it with and without the added smtp configurations. config.action_mailer.default_url_options = { :host => 'localhost' } config.action_mailer.delivery_method = :smtp ... Have I defined host incorrectly? 回答1: The files