plataformatec / devise
- Source
- Commits
- Network (33)
- Issues (3)
- Downloads (1)
- Wiki (4)
- Graphs
-
Branch:
master
-
Install a vanilla app and include Devise.
User spec
describe User do
before(:each) do@valid_attributes = { :email => "me@mycompany.com", :password => "tops3cret" }end
it "should create a new instance given valid attributes" do
User.create!(@valid_attributes)end end
Run the spec, it fails...
ActionView::TemplateError in 'User should create a new instance given valid attributes'
Missing host to link to! Please provide :host parameter or set default_url_options[:host]
On line #5 of app/views/devise_mailer/confirmation_instructions.html.erbThat seems clear, so i put this in config/environments/test.rb
config.action_mailer.default_url_options = { :host => 'localhost:3000' }Now the test passes, awesome.
Here's the weird part, I need to create a User in a cucumber step definition. So i copy the exact same code from the spec
Given /^that I am a member of a company$/ do
@company = Company.new(:name => "My Company") @valid_attributes = {:email => "me@mycompany.com", :password => "tops3cret"} @user = User.create!(@valid_attributes) @company.user << @user end
That User.create fails ... guess what the error is?
Scenario: Viewing a client # features/create_client.feature:15
Given that I am a member of a company # features/step_definitions/create_client.rb:7 Missing host to link to! Please provide :host parameter or set default_url_options[:host] (ActionView::TemplateError) On line <a href="/plataformatec/devise/issues/#issue/5" class="internal">#5</a> of app/views/devise_mailer/confirmation_instructions.html.erbI'd love some feedback on this. I don't know what to debug as the definition they want is there
Comments
-
Not compatible with MongoMapper (Validations plugin)
1 comment Created 4 days ago by UVSoftHello!
Please have a look at this line:
Here you can see three arguments to the 'add' method, but look at:
http://github.com/jnunemaker/validatable/blob/master/lib/validatable/errors.rb#L34
Only two arguments are possible. This plugin (Validatable) is used by MongoMapper. The author of the plugin doesn't want to fix this problem, so I describe it here.
Best regards,
Ivan Ukhov.Comments
This was already fixed in master. If not available in the latest gem, should be in the next release.
http://github.com/plataformatec/devise/blob/master/lib/devise/models/confirmable.rb#L130
If you need it now, you can vendor devise.
-
We definitely need a way to skip confirmable- When an administrator creates a new account you just dont want to have an email notification goes to annoy your users.
Comments
Take a look into Devise::Models::Confirmable:
http://github.com/plataformatec/devise/blob/master/lib/devise/models/confirmable.rb#L89
-
Devise tests maybe should not fail when MongoDB is not used in the system?
==> Devise.orm = :mongo_mapper /Library/Ruby/Gems/1.8/gems/mongo-0.18.1/lib/../lib/mongo/connection.rb:279:in `connect_to_master': failed to connect to any given host:port (Mongo::ConnectionFailure) from /Library/Ruby/Gems/1.8/gems/mongo-0.18.1/lib/../lib/mongo/connection.rb:133:in `initialize' from ./test/orm/mongo_mapper.rb:3:in `new' from ./test/orm/mongo_mapper.rb:3 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from ./test/test_helper.rb:7 from ./test/controllers/filters_test.rb:1:in `require' from ./test/controllers/filters_test.rb:1 from /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `load' from /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5 from /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5:in `each' from /Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake/rake_test_loader.rb:5Comments
-
undefined method `find_template' for []:Array
15 comments Created 14 days ago by yannskiWhen I try to send the mail for the confirmation instructions, I get this :
I'm using MongoMapper mongo_mapper (0.6.8) and devise (0.7.3) and warden (0.6.5)
Comments
You need to set the mailer sender:
http://github.com/plataformatec/devise/blob/master/generators/devise_install/templates/devise.rb#L46
Blame Rails for this terrible error message. I will set this mailer sender to a default value, something like: please-change-me@devise-config.com
Odd, but better than this weird error.
I modified the mailer sender, as seen on http://pastie.org/751644 (yep, I will rechange the secret after that :)
But I still get exactly the same error.
Odd, odd. :/
Try searching past issues, because this error already popped up here, and more than one time.
Yep, I've seen http://blog.plataformatec.com.br/2009/11/devise-authentication-for-lazy-programmers/comment-page-1/#comment-367 but I didn't find anything in the issues
Your application is fresh or an already existing one?
Fresh.
In fact, I had already defined this in environments/development.rb :
DeviseMailer.sender = "no-reply@yourapp.com"
config.action_mailer.default_url_options = { :host => 'localhost:3000' }But now, I commented DeviseMailer.sender = "no-reply@yourapp.com" and added config.mailer_sender = "notifications@mastersieve.com" in devise.rb, and now it works.
This is one of them:
http://github.com/plataformatec/devise/issues/closed#issue/43
There was another similar issue, but I can't find it. The failure was due to another plugin monkey patching Rails (I think it was thinking_sphinx). So that's why it would be nice if you could try that in a fresh app :)
I don't think so. BTW, I try devise especially because of its mongo_mapper support !
This is odd. :/ There are people using MongoMapper with Devise successfully, I will ask on the mailing list for some of them to ping here to see if they have a clue.
Ok, the whole test suite now runs with MongoMapper and I cannot reproduce it. So I kindly ask you to try to reproduce the error in the test suite.
To execute MongoMapper tests, git pull and do:
DEVISE_ORM=mongo_mapper rake test
Thanks!
weird error, i'm using devise and mongo_mapper i've never seen this. I ran the rake task devise_install and configured the sender in the initializer setup block, not my environment.rb
fakingfantastic
Fri Jan 01 14:48:11 -0800 2010
| link
I was just spending all day trying to chase down this error. It's a fresh app, only gem being used is devise.
One of the first things I coded was the spec.
User.create!(@valid_attributes)It was throwing the error. Following the link josevalim posted worked. My issue was that I had DeviseMailer.sender = "no-reply@yourapp.com" in test.rb when I should have had config.mailer_sender = "foo.bar@yourapp.com" in the config/initializer/devise.rb
Since I was following the instructions blindly, I either followed them badly, or you guys should update the instructions accordingly .. but it was most likely my fault.
-
Image-stacktraces are nicer ;)
http://skitch.com/grimen/nm481/action-controller-exception-caught
Btw, this can be avoided (in most cases) by setting encoding on top of each Ruby-file like so: # encoding: utf-8. I do this myself by practice, because it's a common Ruby 1.9 issue. I got a plan B too if you need. =)
Comments
-
is it possible to get these two working together?
Comments
Which error are you getting? If mongo_mapper mimics validatable API, you should be able.
ArgumentError: invalid options: scope from /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/jnunemaker-validatable-1.8.1/lib/validatable/understandable.rb:27:in `must_understand' from /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/jnunemaker-validatable-1.8.1/lib/validatable/validations/validation_base.rb:47:in `initialize' from /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/jnunemaker-validatable-1.8.1/lib/validatable/validatable_class_methods.rb:66:in `new' from /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/jnunemaker-validatable-1.8.1/lib/validatable/validatable_class_methods.rb:66:in `add_validations' from /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/jnunemaker-validatable-1.8.1/lib/validatable/validatable_class_methods.rb:65:in `each' from /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/jnunemaker-validatable-1.8.1/lib/validatable/validatable_class_methods.rb:65:in `add_validations' from /opt/ruby-enterprise-1.8.6-20090610/lib/ruby/gems/1.8/gems/jnunemaker-validatable-1.8.1/lib/validatable/macros.rb:49:in `validates_format_of' from /Users/mattmini/dev/ror/coupon/vendor/gems/devise-0.7.1/lib/devise/models/validatable.rb:23:in `included' from /Users/mattmini/dev/ror/coupon/vendor/gems/devise-0.7.1/lib/devise/models/validatable.rb:20:in `class_eval' from /Users/mattmini/dev/ror/coupon/vendor/gems/devise-0.7.1/lib/devise/models/validatable.rb:20:in `included' from /Users/mattmini/devYou should ask mongo_mapper guys why they do not accept scope option in validates_uniqueness_of. However I will try to provide a fix that should work on 80% of the cases.
-
Failure messages should be scoped by failing strategy
1 comment Created 20 days ago by josevalim -
Consider (line:103) render :template =>
"sessions/#{devise_mapping.as}/#{action}"Assuming a 'users' devise mapping exists, a consequence of this is:
/users/sign_in will render "sessions/users/new" /users/password/new will render "sessions/users/new"A solution would be to change the PasswordsController (and
ConfirmationsController) to use a 'render_with_confirmation_scope' and
'render_with_passwords_scope' methods, which use a directory path other than 'sessions'.I'm working on a fix right now and will be issuing a pull request for
the changes.Comments
-
Hello!
I can't relogin user with sign_in helper while testing with RSpec: logged in once current_user never changed again.
Warden shows changed user, but the current_user returns old user.
May be I don't clearly understand how it works.Steps to reproduce:
1) in test:
describe UsersController do it 'should relogin user' do user1 = Factory(:user) user1.confirm! user2 = Factory(:user) user2.confirm! puts "Signing in user1" sign_in user1 get('index') puts " warden.user.id = #{warden.user.id}" puts " current_user = #{response.body}" puts "Signing in user2" sign_out user1 sign_in user2 get('index') puts " warden.user.id = #{warden.user.id}" puts " current_user = #{response.body}" end end2) in controller:
def index render :json => {:id => current_user.id} end3) result:
$ rake spec:controllers Signing in user1 warden.user.id = 22 current_user = {"id":22} Signing in user2 warden.user.id = 23 current_user = {"id":22}Comments
Probably because the controller is caching the resource. Have you tried doing:
@controller.instance_variable_set(:@current_user, nil)
And check if the problem persists?
-
Hi,
I don't understand how to override SessionsController::New method in Devise.
I want to check if there's a user signed in and in that case redirect to other controller/action. How can I do this?
Thanks
Comments
carlosantoniodasilva
Sun Dec 13 17:09:30 -0800 2009
| link
Hello!
Devise already redirect the user to its home page (ie user_root_path) when you access the sign in page and the user is already signed in. You can also override the :after_sign_in_path_for method inside application controller to redirect the user to another action, or you can set a before filter to sessions controller like:
# Skip default before filter from devise if you don't want it SessionsController.skip_before_filter :require_no_authentication # Add your own before filter, define it inside application controller. SessionsController.before_filter :my_filter, :only => [:new, :create]You can put it inside an initializer.
That should do the trick.Ok.
I hadn't realized that it was skipping to my root path because my root path is also the page where I have the login.
Thanks
carlosantoniodasilva
Sun Dec 13 17:27:07 -0800 2009
| link
Right. You're welcome..
I'd ask you to use google group to ask for help about doubts you may have, there other people are able to see and help too.
http://groups.google.com/group/plataformatec-devise
Thanks. Closing. -
Copying locale should be part of the installation process
1 comment Created 23 days ago by josevalim -
Feature/Bug/Improvement: Recoverable should validate the reset_password_token
2 comments Created 24 days ago by fisonsreset_password_tokens should be valid - when trying to reset a password with an invalid password token there should pop an validation error saying "invalid reset_password_token" or something.
Comments
carlosantoniodasilva
Fri Dec 11 09:08:15 -0800 2009
| link
Devise just validate the reset password token when you really submit the edit password form. Then it shows you if your token is invalid or not, together with password validation, adding errors to your model.
-
I noticed that "Invitable" is no longer a planned module. I was rather looking forward to that one. Any chance that might move back on the table in the future?
Best Regards,
David BaldwinComments
carlosantoniodasilva
Fri Dec 11 02:06:12 -0800 2009
| link
Hello David,
We are not planning to create invitable right now, there are still some points to be checked before adding it.
However, you can take a look at http://wiki.github.com/plataformatec/devise/3rd-party-extensions. There is already an extension created that allows you using invitable, and also a facebook connection.
Thanks,
Carlos.
baldwindavid
Fri Dec 11 09:00:18 -0800 2009
| link
Oh great. I missed that. Thanks Carlos.
carlosantoniodasilva
Fri Dec 11 09:02:59 -0800 2009
| link
You're welcome. Closing.
-
Can't extend Devise: modules = Devise::ALL & modules
3 comments Created 25 days ago by grimenSee my last comment:
http://github.com/plataformatec/devise/commit/9095d525b2d3b0e50a4e676d4ee51ecb3647842d
Comments
-
I don't have this issue with Ruby 1.8... The traditional gem loading issue I guess.
grimen@c-05f7e255:devise_plugin/devise_example ‹master*›$ rvm use 1.9 grimen@c-05f7e255:devise_plugin/devise_example ‹master*›$ ss => Booting WEBrick => Rails 2.3.4 application starting on http://0.0.0.0:3000 /Users/grimen/.rvm/gems/ruby/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require': no such file to load -- warden (MissingSourceFile) from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `block in require' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from /Users/grimen/Development/examples/devise_plugin/devise_example/vendor/plugins/devise/lib/devise.rb:142:in `' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `block in require' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from /Users/grimen/Development/examples/devise_plugin/devise_example/vendor/plugins/devise/init.rb:2:in `block in evaluate_init_rb' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/rails-2.3.4/lib/rails/plugin.rb:158:in `eval' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/rails-2.3.4/lib/rails/plugin.rb:158:in `block in evaluate_init_rb' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/activesupport-2.3.4/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/rails-2.3.4/lib/rails/plugin.rb:154:in `evaluate_init_rb' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/rails-2.3.4/lib/rails/plugin.rb:48:in `load' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/rails-2.3.4/lib/rails/plugin/loader.rb:38:in `block in load_plugins' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/rails-2.3.4/lib/rails/plugin/loader.rb:37:in `each' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/rails-2.3.4/lib/rails/plugin/loader.rb:37:in `load_plugins' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/rails-2.3.4/lib/initializer.rb:369:in `load_plugins' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/rails-2.3.4/lib/initializer.rb:165:in `process' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/rails-2.3.4/lib/initializer.rb:113:in `run' from /Users/grimen/Development/examples/devise_plugin/devise_example/config/environment.rb:9:in `' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `block in require' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from /Users/grimen/.rvm/gems/ruby/1.9.1/gems/rails-2.3.4/lib/commands/server.rb:84:in `' from ./script/server:3:in `require' from ./script/server:3:in `'
Comments
-
Hi,
is there a standard-way of adding a filter (skip-filter) to a devise-controller? Need this for skipping authorization-logik in SessionsController...
My authorization-filter is monkey-patched into ApplicationController in config/initializers/ - trying to monkey-patch the skip-filter into SessionsController does not help. Any hints for this?
Comments
Please send some code of what you are trying to achieve.
in ApplicationController:
class ApplicationController < ActionController::Base
[..] before_filter :check_permissions # uses current_user... [..] endSessionsController should have a "skip_filter :check_permissions" because everyone should be able to logout/login...
I know i can copy the devise-sessions_controller to app/controllers and modify it but it feels wrong - so how can i "add" a skip-filter statement to the devise "SessionsController"?
Yeah, this is a Rails Engine issue. You can solve it in different ways, but none of them feels write. One of them is ensure that SessionsController is loaded before the filter is loaded:
class ApplicationController < ActionController::Base # common logic to SessionsController SessionsController # logic not shared with SessionsController endI would personally do this:
SessionsController.skip_before_filter :check_permissionsThanks! - your code looks good but does not work with my authorization-solution (Aegis). I solved my issue by adding a "return if is_a?(SessionsController)" into the
check_permissions-method of Aegis.But would'nt it be nice to have a devise-config-option for adding/skipping filters, as others may have the same problem skipping e.g. the authorization in sessions_controller just as me?
I cannot think on how a configuration option should work. But you may want to change your filter to "return if devise_controller?", it returns true for all Devise internal controllers. :)
Ah, for future questions, please use the mailing list instead:
http://groups.google.com/group/plataformatec-devise
Thanks!
-
...which makes sense unless you want to use another authentication solution. This is what I do now:
class User < ActiveRecord::Base #devise :all devise :facebook_connectable end
But I get "Invalid email or password." when calling sessions/create with sufficient parameters for a Facebook Connect authentication. See details on what I do under the hood in the extension here:
Comments
I guess this is not true. This is because the default failure message is :invalid, which is "Invalid email or password". Are you sure you added your facebook strategy in Warden default strategies?
This is what I got in the Initializer:
config.all = [:facebook_connectable, :authenticatable, :confirmable, :recoverable, :rememberable, :timeoutable, :trackable, :validatable]
But warden.authenticate don't seems to enter my strategy. Using debugger I managed to see that :authenticable is enabled by default and ignores my devise :facebook_connectable instruction in the User model (I don't enable any other devise there). This is the deepest info I can get using the debugger:
(rdb:10) Devise::Mapping.find_by_path(request.path)
#"sign_in", :confirmation=>"confirmation", :password=>"password", :sign_out=>"sign_out"}, @as=:users, @for=[:authenticatable]>
...then I get:
(rdb:11) l [-4, 5] in (eval) *** No sourcefile available for (eval)
=P
OMG! :)
config.all is about devise modules. In the same initializer file, there is a config.warden piece. Please add the following:
config.warden do |manager| manager.default_strategies.unshift :facebook_connectable endOr add it to Devise::STRATEGIES constant.
I tried both (had to remove .freeze on Devise::STRATEGIES to try that one), none works for me. =(
A-ha (with a ?! suffix): Devise is for some reason loading :authenticable by default AND an extra one instead of :facebook_connectable always:
First I get these:
DEPRECATION WARNING: :authenticatable won't be included by default in devise in future versions, please add it. (called from /Users/grimen/Development/examples/devise_plugin/devise_example/app/models/user.rb:3)
then with Rails footnotes I see:
#"sign_in", :confirmation=>"confirmation", :password=>"password", :sign_out=>"sign_out"}, @as=:users, @for=[:authenticatable, :trackable, :authenticatable]>
...even though the only ones I enabled are :facebook_connectable and :trackable (just for testing what happens). See 2 x :authenticatable, but in the model only got :trackable and :facebook_connectable.
Oh yeah, sorry! Devise still forces the loading of authenticatable. I added the warning because we want to remove it in future versions. :( You will have to hack it or work on a Devise fork. :(
-
When I try to override sessions/new.html.erb (in Devise) with sessions/new.html.haml (in my App) it Ignores that one: Only when I use .erb it works.
Comments
This is not supposed to be a Devise bug, but a Rails Engine bug. :( I will have to do some debugging to see why this happens. In the meanwhile, the other haml views works flawlessly?
OK, I see. Well this one can be handled by calling a HAML partial from that view, so I guess it's not critical like that. Just annoying. =)
Maybe there is something like template engine priority and you can set haml views to be used. I will try to come up with a Rails patch later.
Don't bother, I cannot reproduce this anymore. It must have been an issue with my extension at that time or something. =S
-
Route loading problems if purely using Gemfile Bundler environment loading.
1 comment Created about 1 month ago by byuWhen using bundler http://yehudakatz.com/2009/11/03/using-the-new-gem-bundler-today/, we get "undefined method
devise'" when trying to load in the routes unless "config.gem 'devise'" is also present in config/environment.rb.rake routes` and script/server will fail with the error.Gemfile:
bundle_path 'vendor/bundler_gems'
clear_sources
source 'http://gems.rubyforge.org/'
source 'http://gemcutter.org'
gem 'mysql'
gem 'rack'
gem 'rails', '2.3.4'
gem 'warden'
gem 'devise'
=end gemfileReproducible by:
1. Set up the blank rails project
2. Add the Gemfile
3. rungem bundle
4. Use the script/generate devise_install
5. script/generate devise Model
6. rake routes
Comments
-
[BUG] Inflections break generation of authentication filters and accessor helpers
8 comments Created about 1 month ago by fisonsEnabling the "ActiveSupport::Inflector.inflections do |inflect|"-block (even without redeclaring/adding custom inflections) in "config/initializers/inflections.rb" breaks the generation of authentication-filters and accessor-helpers (e.g. user_signed_in? user_session current_user (given User was 'devisified'))
Comments
Mate, can I ask you to add some failing tests on the test suite?
I'll have a look later today, trying to add failing tests
I just remembered you can configure all the given values. Have you tried the following:
map.devise_for :users, :scope => :user
It should solve the inflection trick. :)
I just forked your gem and added "config/initializers/inflections.rb" to the testsuite, now we have failing tests ;)
Your inflection-trick did not work - have a look at my devise_example-fork, i committed a not-working example with inflections & inflections-trick enabled...
I consider this a critical bug as it would affect everyone who uses inflections (which could be a lot of people, especially in non-english-speaking countries; in my company we develop most rails-apps with germanized models/attribute-names, so customizable inflections are a 'must-have' for us.
Ok, fixed and released Devise 0.6.3.
For some strange reason, calling Inflections make routes be loaded twice, messing with Devise load stack.
-
Hi there,
since I updated from 0.6.0 to 0.6.2 I get the following error when I create & authenticate a new user:
And I press "Create" # features/step_definitions/webrat_steps.rb:19 undefined method `current_sign_in_at' for #<User:0x7f82ee7facb0> (NoMethodError) /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/attribute_methods.rb:260:in `method_missing' /usr/lib/ruby/gems/1.8/gems/devise-0.6.2/lib/devise/hooks/trackable.rb:5 /usr/lib/ruby/gems/1.8/gems/warden-0.6.4/lib/warden/proxy.rb:259:in `call' /usr/lib/ruby/gems/1.8/gems/warden-0.6.4/lib/warden/proxy.rb:259:in `_perform_authentication' /usr/lib/ruby/gems/1.8/gems/warden-0.6.4/lib/warden/proxy.rb:259:in `each' /usr/lib/ruby/gems/1.8/gems/warden-0.6.4/lib/warden/proxy.rb:259:in `_perform_authentication' /usr/lib/ruby/gems/1.8/gems/warden-0.6.4/lib/warden/proxy.rb:68:in `authenticate' /usr/lib/ruby/gems/1.8/gems/devise-0.6.2/lib/devise/controllers/filters.rb:37:in `authenticate' /media/disk/Taf/2009_SiggyFeed/apps/trunk/rails_www/app/controllers/users_controller.rb:8:in `create'Here is the code:
class UsersController < ApplicationController
def create @user = User.new(params[:user]) if @user.save authenticate(:user) redirect_to root_path else render :template => 'home/welcome' end endend
Comments
Have you executed script/generate devise_install?
When you run this command, it will freeze your devise to only use the modules at Devise 0.6.0. For example, in Devise 0.6.2, we add "trackable", and since your Devise is not frozen, it was automatically added to your models. But everything is failing now, since you didn't added "trackable" to your migrations.
You have three fixes:
1) Revert to Devise 0.6.0, freeze it with script/generate devise_install, return to 0.6.2;
2) Keep 0.6.2 and add t.trackable to your migration
3) Keep 0.6.2 and add "devise :all, :except => :trackable" to your model
-
Hello,
the latest version I pulled doesn't seem to work properly with Ruby 1.8.6. The problem appears when calling
@user.confirm_withinIt works on Devise 0.5.5 and Ruby 1.8.6.
It also works on Devise 0.6.2 and Ruby 1.8.7
But it doesn't work on Devise 0.6.2 and Ruby 1.8.6. Reports that it can't with the method "confirm_within".
Comments
-
confirmable with confirm_within = 0.days allows the user to signup anyway.
6 comments Created about 1 month ago by EmmanuelOgaI had to put this on my User model cause confirm_within = 0.days does not seem to work properly
def confirmation_period_valid?
falseend
By the way, the intuitive use of confirmable imho is make it 0.days. Normally sites do not enable you to login until you click on the confirmation link. The documentation says the default confirm_within is nil but it does not seem to be working properly. One more thing, I would change the name of the setting:
config.signup_allowed_without_confirming_period = 2.days
or something, you get the idea.
Comments
In which scenario 0.days does not work properly? And in which devise version? I will fix that as soon as I have more details, but no plan on changing the api for a while. Thanks!
EmmanuelOga
Fri Nov 27 09:25:02 -0800 2009
| link
hey, sorry for the missing info. version is 0.6.2, scenario is, in a model configured as follows:
class User < ActiveRecord::Base devise :authenticatable, :validatable, :recoverable, :confirmable endI create a new record and then I'm able to login right after the user is created, even when config.confirm_within = 0.days. After I overwrite the confirmation_period_valid? method as described, I get the behavior I need.
Thanks for the info, but this is still odd. This is the confirmation period valid implementation:
def confirmation_period_valid? confirmation_sent_at && confirmation_sent_at >= self.class.confirm_within.ago endconfirmation_sent_at is set before saving the user and confirm_within.ago when confirm_within is equal to 0.days is the same as Time.now. That should not return true in any condition, even more if we consider that the line below in irb returns false:
Time.now >= Time.now #=> falseSo I think it may be a timezone issue. Can you try something along those lines in your application console:
User.create(valid_attributes).confirmation_sent_at >= 0.days.ago User.create(valid_attributes).confirmation_sent_at >= 0.hours.ago User.create(valid_attributes).confirmation_sent_at >= 1.hour.from_now User.create(valid_attributes).confirmation_sent_at >= 1.hour.agoAll should return false, except for the last one.
Thanks! :)
EmmanuelOga
Wed Dec 02 12:50:30 -0800 2009
| link
hey, sorry, I was in a hurry and just left my workaround in place. I'll try to create a failing spec for this. I'll come back to you with the news later today.
-
Hi plataformatec,
Devise has support for namespaces?
My application have authentication only into admin scope and I want to use Devise for that.
I tried this:
ActionController::Routing::Routes.draw do |map| map.namespace 'admin' do |admin| admin.devise_for :users end endAnd I get into rake routes:
(in /home/sobrinho/projetos/xxx) new_user_session GET /admin/users/sign_in {:action=>"new", :controller=>"admin/sessions"} user_session POST /admin/users/sign_in {:action=>"create", :controller=>"admin/sessions"} destroy_user_session GET /admin/users/sign_out {:action=>"destroy", :controller=>"admin/sessions"}Well, admin/sessions doesn't exist. Then i renamed route to use sessions controller:
ActionController::Routing::Routes.draw do |map| map.namespace 'admin' do |admin| admin.devise_for :users, :controller => 'sessions' end endBut i get
Unknown action
error when i access login page.Haven't support or i'm doing something wrong?
Comments
Try giving :path_prefix => "admin" instead. It should be almost the same as namespace, but without the adding admin_ to named routes (which wouldn't work anyway).
Looking at log:
Processing Admin::SessionsController#new (for 127.0.0.1 at 2009-11-23 19:13:37) [GET] Parameters: {"action"=>"new", "controller"=>"admin/sessions"} ActionController::UnknownAction (ActionController::UnknownAction): devise (0.5.5) lib/devise/controllers/helpers.rb:50:in `is_devise_resource?' haml (2.2.13) rails/./lib/sass/plugin/rails.rb:19:in `process' warden (0.6.4) lib/warden/manager.rb:84:in `call' warden (0.6.4) lib/warden/manager.rb:84:in `call' warden (0.6.4) lib/warden/manager.rb:83:in `catch' warden (0.6.4) lib/warden/manager.rb:83:in `call' Rendering rescues/layout (not_found)If i set devise_for outside namespace this works fine
@josevalim
i tried but i got the same error:
map.devise_for :users, :path_prefix => 'admin', :controller => 'sessions'
Processing SessionsController#new (for 127.0.0.1 at 2009-11-23 19:18:00) [GET] ActionController::UnknownAction (ActionController::UnknownAction): devise (0.5.5) lib/devise/controllers/helpers.rb:50:in `is_devise_resource?' haml (2.2.13) rails/./lib/sass/plugin/rails.rb:19:in `process' warden (0.6.4) lib/warden/manager.rb:84:in `call' warden (0.6.4) lib/warden/manager.rb:84:in `call' warden (0.6.4) lib/warden/manager.rb:83:in `catch' warden (0.6.4) lib/warden/manager.rb:83:in `call' Rendering rescues/layout (not_found)
-
apply_schema :encrypted_password, String, :null => null, :limit => Devise::ENCRYPTORS_LENGTH[encryptor]
Devise::ENCRYPTORS_LENGTH is a hash of symbol, but 'encryptor' returns a class so the look up always returns a nil.
Comments
carlosantoniodasilva
Sun Nov 22 15:05:24 -0800 2009
| link
Hello, are you using a different encryptor than the defaul Sha1? To use a different encryptor, you must use a symbol that represents it (ie :sha1 or :sha512) in devise config file.
-
I want it to simply be '/login', and '/logout'
I managed to do so by adding these to the routes file
map.login 'login', :controller => :sessions, :action => :new, :conditions => { :method => :get } map.login 'login', :controller => :sessions, :action => :create, :conditions => { :method => :post } map.logout 'logout', :controller => :sessions, :action => :destroy
But I still have a problem with the before_filter :authenticate_user! where it still redirects the user to 'http://localhost:3000/users/sign_in?unauthenticated=true'.
I would really appreciate it if you can tell me how to override the login url. Thanks.
Comments
-
def confirmed_at?
confirmed_atend
def confirmation_sent_at?
confirmation_sent_atend
def remember_token?
remember_tokenend
it seems that activerecord defines attribute_method with ? and datamapper doesnt
Comments
Awesome, just fixed and pushed!
Please report any other problem, so I can release a compatible gem soon! :)this is what i have to do to get the datamapper to work in the user model
class User
include DataMapper::Resource class << selfdef before_create method end def after_create method end def find(method, opts) first(opts[:conditions]) end alias validates_presence_of validates_present alias validates_uniqueness_of validates_is_unique alias validates_format_of validates_format alias validates_confirmation_of validates_is_confirmed alias validates_length_of validates_lengthend
property :id, Serial property :username, String, :length => 255, :unique => true property :email, String, :index => true, :nullable => false, :length => 1000 property :encrypted_password, String, :length => 255, :nullable => false property :password_salt, String, :length => 255, :nullable => false property :confirmation_token, String, :length => 20 property :confirmed_at, DateTime property :confirmation_sent_at, DateTime property :reset_password_token, String, :length => 20 property :remember_token, String, :length => 20 property :remember_created_at, DateTime
extend Devise::Models
devise :all
def confirmed_at?
confirmed_atend
def confirmation_sent_at?
confirmation_sent_atend
def remember_token?
remember_tokenend def save(flag = nil)
super()end end
most noteworth things are the before_save and after_save callback, find, and save(false)
just take care of those and you will have a compatible gem hehe.
class User
include DataMapper::Resource class << selfdef before_create method end def after_create method end def find(method, opts) first(opts[:conditions]) end alias validates_presence_of validates_present alias validates_uniqueness_of validates_is_unique alias validates_format_of validates_format alias validates_confirmation_of validates_is_confirmed alias validates_length_of validates_lengthend
property :id, Serial property :username, String, :length => 255, :unique => true property :email, String, :index => true, :nullable => false, :length => 1000 property :encrypted_password, String, :length => 255, :nullable => false property :password_salt, String, :length => 255, :nullable => false property :confirmation_token, String, :length => 20 property :confirmed_at, DateTime property :confirmation_sent_at, DateTime property :reset_password_token, String, :length => 20 property :remember_token, String, :length => 20 property :remember_created_at, DateTime
extend Devise::Models
devise :all
has n, :external_accounts has 1, :facebook_account
accepts_nested_attributes_for :facebook_account
def confirmed_at?
confirmed_atend
def confirmation_sent_at?
confirmation_sent_atend
def remember_token?
remember_tokenend def save(flag = nil)
super()end
Awesome! Just updated once again.
Can you please install Devise as a plugin and try to use it with Datamapper? The required steps are:
1) Install Datamapper
2) ruby script/generate devise_install
3) Change config.orm = :data_mapper in "config/initializers/devise.rb"
4) Change your model above to the following:class User include DataMapper::Resource property :id, Serial alias validates_presence_of validates_present alias validates_uniqueness_of validates_is_unique alias validates_format_of validates_format alias validates_confirmation_of validates_is_confirmed alias validates_length_of validates_length devise :all has n, :external_accounts has 1, :facebook_account accepts_nested_attributes_for :facebook_account endI tried to handle everything in Devise, except the validations, which won't be added unless you define aliases by hand.
-
Perhaps it would be helpful to have flexible views for different Devise resources (users, admins, etc.). For example, an admin login form might need to be very different from a user sign-up page, yet both views are currently called from
SessionsController#newwhich renderscontrollers/views/sessions/new.html.erb. It would be really useful to be able to rendercontrollers/views/sessions/admins/new.html.erb, orcontrollers/views/sessions/users/new.html.erb, or some other specified view.For now, we can include conditional logic in
controllers/views/sessions/new.html.erb(e.g., if we're dealing with users, render form x, else render form y for admins), but this makes for a brittle view. Is there currently a cleaner way to do this? Or might this kind of view customization be a useful feature to add?Comments
Just added. Run "script/generate devise_install" and set the config.scoped_views options to true. Have fun!
Of course, don't forget to install new devise version before!
logicaltext
Sat Nov 21 14:15:58 -0800 2009
| link
@josevalim: A very elegant solution, thank you!
-
undefined method `find_template' for []:Array
7 comments Created about 1 month ago by latrommiHi!
I have got following error on user.save:
undefined method `find_template' for []:ArrayRails 2.3.4.
Also I didscript/generate devise_viewsbefore saving users.Backtrace:
/usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:582:incandidate_for_layout?' /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/layout.rb:240:inpick_layout' /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:566:inrender' /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:553:inrender_message' /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:493:increate!' /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:452:ininitialize' /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:395:innew' /usr/lib/ruby/gems/1.8/gems/actionmailer-2.3.4/lib/action_mailer/base.rb:395:inmethod_missing' /usr/lib/ruby/gems/1.8/gems/devise-0.5.5/lib/devise/models/confirmable.rb:59:insend_confirmation_instructions' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:178:insend' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:178:inevaluate_method' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:166:incall' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:93:inrun' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:92:ineach' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:92:insend' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:92:inrun' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/callbacks.rb:276:inrun_callbacks' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/callbacks.rb:344:incallback' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/callbacks.rb:267:increate' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2867:increate_or_update_without_callbacks' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/callbacks.rb:250:increate_or_update' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:2538:insave_without_validation' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/validations.rb:1078:insave_without_dirty' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/dirty.rb:79:insave_without_transactions' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:229:insend' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:229:inwith_transaction_returning_status' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/connection_adapters/abstract/database_statements.rb:136:intransaction' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:182:intransaction' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:228:inwith_transaction_returning_status' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:196:insave' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:208:inrollback_active_record_state!' /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/transactions.rb:196:insave'Comments
Can you duplicate this bug running devise example at http://github.com/plataformatec/devise_example ?
I find it!
It hapens when
DeviseMailer.sender = "no-reply@yourapp.com"is defined in environments/development.rb
Where I should write it?
carlosantoniodasilva
Sat Nov 21 16:07:41 -0800 2009
| link
Hello!
You should remove this config (it's from old versions) and run the following generator:
ruby script/generate devise_installThis generator will copy a config file under your config/initializers named devise.rb.. There you can setup your mail sender:
config.mailer_sender = "foo.bar@yourapp.com"Let us know if it works.
It works, yeah. Thank you!
Please, update your README to prevent this mistake with new users.
carlosantoniodasilva
Sat Nov 21 16:22:15 -0800 2009
| link
Glad to help.
Our mistake, it really shouldn't be there anymore. I will do it as soon as possible.
Thanks.config.mailer_sender is just a wrapper to DeviseMailer.sender:
http://github.com/plataformatec/devise/blob/master/lib/devise.rb#L89
I guess it's not the issue, unless I'm missing something. :(
-
build_resouce method doesnt work with datamapper
1 comment Created about 1 month ago by trungphamfor sign in page.
DataMapper.new blow up if you pass in a nil
suggesting fix
# Build a devise resource without setting password and password confirmation fields. def build_resource self.resource ||= begin attributes = params[resource_name].try(:except, :password, :password_confirmation) resource_class.new(attributes || {}) end endComments
-
user_signed_in? doesn't work in test environment
2 comments Created about 1 month ago by trevorturkI'm sure I'm doing something wrong, but I can't figure out what. Please help! :)
This works fine in my browser, but fails in my tests. Do I need to include some kind of test helper or something?
The test: http://pastie.org/708343
Comments
trevorturk
Fri Nov 20 15:23:01 -0800 2009
| link
Sorry - this issue was posted twice.
-
user_signed_in? doesn't work in test environment
4 comments Created about 1 month ago by trevorturkI'm sure I'm doing something wrong, but I can't figure out what. Please help! :)
This works fine in my browser, but fails in my tests. Do I need to include some kind of test helper or something?
The test: http://pastie.org/708343
Comments
trevorturk
Fri Nov 20 15:26:35 -0800 2009
| link
This is the same thing if I try to use authenticate_user!
Hello,
I'm testing my application with cucumber and I have some trouble getting the current_user to be created. I tried using the sign_in method in my steps definitions but it fails... Anyone had a chance to make this work with cucumber ?
Thx
The sign_in method in Devise::TestHelpers should be used in functional tests, where you need mocking. To sign in your users in integrations tests, just go to the sign page and fill in the form (it's an integration test!) or store the user direct in session (works for webrat, but not for selenium, culerity...).
-
Wanted to give devise a try instead of authlogic.
I set everything up as desribed in the README, but when trying to start the server or even trying "rake db:migrate" I get the following error:
"uninitialized constant Devise::Encryptors"
Details:
... rake aborted!
uninitialized constant Devise::Encryptors
/usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:440:inload_missing_constant' /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:inconst_missing' /home/cjk/work/hot/hotrails/vendor/gems/devise-0.5.5/lib/devise.rb:57 /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' ...I use devise 0.5.5 and latest version of warden.
Thanks!
Comments
I just pushed a patch that tries to fix it. Could you please reinstall Devise 0.5.5 and give it a try?
Your patch got me one step further, but there were more missing constants.
So what I did was:
add
require 'devise/schema'
to orm/active_record.rb
also add
require 'devise/mapping'
require 'devise/controllers/filters'
require 'devise/controllers/url_helpers'to rails/routes.rb
After that, script/server was no longer complaining and rake db:migrate was running as well.
Not sure this is the right way to do it, but it worked for me so far. I just wonder why not anyone else seems to experience this.
Just re-released 0.5.5 again. Can you try one more time please?
No, not using Bundler.
But I got another error after adding
map.devise_for :users
to my routes.rb:
% script/server => Booting WEBrick => Rails 2.3.4 application starting on http://0.0.0.0:3000 /usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:1959:in
method_missing_without_paginate': undefined methoddevise' for #<Class:0x2b1e852e6610> (NoMethodError)from /home/cjk/work/hot/hotrails/vendor/gems/mislav-will_paginate-2.3.11/lib/will_paginate/finder.rb:170:in `method_missing' from /home/cjk/work/hot/hotrails/app/models/user.rb:2 from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:380:in `load_without_new_constant_marking' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:380:in `load_file' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:379:in `load_file' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:259:in `require_or_load' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:425:in `load_missing_constant' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `const_missing' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:92:in `const_missing' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/inflector.rb:361:in `constantize' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/inflector.rb:360:in `each' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/inflector.rb:360:in `constantize' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/string/inflections.rb:162:in `constantize' from /home/cjk/work/hot/hotrails/vendor/gems/devise-0.5.5/lib/devise/mapping.rb:80:in `to' from /home/cjk/work/hot/hotrails/vendor/gems/devise-0.5.5/lib/devise/mapping.rb:74:in `for' from /home/cjk/work/hot/hotrails/vendor/gems/devise-0.5.5/lib/devise/rails/routes.rb:98:in `devise_for' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/object/misc.rb:78:in `with_options' from /home/cjk/work/hot/hotrails/vendor/gems/devise-0.5.5/lib/devise/rails/routes.rb:97:in `devise_for' from /home/cjk/work/hot/hotrails/vendor/gems/devise-0.5.5/lib/devise/rails/routes.rb:90:in `each' from /home/cjk/work/hot/hotrails/vendor/gems/devise-0.5.5/lib/devise/rails/routes.rb:90:in `devise_for' from /home/cjk/work/hot/hotrails/config/routes.rb:3 from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:226:in `draw' from /home/cjk/work/hot/hotrails/config/routes.rb:1 from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in `load_without_new_constant_marking' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in `load' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in `load' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:286:in `load_routes_without_devise!' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:286:in `each' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:286:in `load_routes_without_devise!' from /home/cjk/work/hot/hotrails/vendor/gems/devise-0.5.5/lib/devise/rails/routes.rb:12:in `load_routes!' from /usr/lib/ruby/gems/1.8/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:266:in `reload!' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:537:in `initialize_routing' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:188:in `process' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run' from /home/cjk/work/hot/hotrails/config/environment.rb:12 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/server.rb:84 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from script/server:3My user-model looks like this (and works without the route):
class User < ActiveRecord::Base
devise :all, :except => :confirmable end
This is completely odd. It seems that you load stack is not working properly because devise with Rails 2.3.4 works properly here. Are you using config.threadsafe! then?
After applying your latest patch, "uninitialized constant Devise::Encryptors" is back:
... => Rails 2.3.4 application starting on http://0.0.0.0:3000 /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:440:in `load_missing_constant': uninitialized constant Devise::Encryptors (NameError)
from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `const_missing' from /home/cjk/work/hot/hotrails/vendor/gems/devise-0.5.5/lib/devise.rb:58 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb:208:in `load' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:307:in `load_gems' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:307:in `each' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:307:in `load_gems' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:164:in `process' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run' from /home/cjk/work/hot/hotrails/config/environment.rb:12 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from /usr/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/commands/server.rb:84 from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /usr/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require' from script/server:3Sorry, but such errors makes no sense. Can you send us your ruby version, rails and gems/plugins? Somone is messing up with Rails load process along the way. You should have the devise method available in your models (it's added in a after_initializer hook) before the routes are loaded, as we can see in Rails source code: http://github.com/rails/rails/blob/2-3-stable/railties/lib/initializer.rb#L126
Finally, could you please ensure that a init.rb is in your gem/plugin root folder?
No, not using config.threadsafe! either. I think my config is pretty standard.
But strange indeed. Never had such problems with my app so far.
The only non-standard rails-code running from the stack-traces seems to be "will_paginate".
Do you have this running as well?
Once I put back
require 'devise/encryptors/sha1'
into devise.rb it starts working until of course I put in the map.devise_for route.
The error then is as stated above:
/usr/lib/ruby/gems/1.8/gems/activerecord-2.3.4/lib/active_record/base.rb:1959:in
method_missing_without_paginate': undefined methoddevise' for #<Class:0x2ba0cb86b950> (NoMethodError)from /home/cjk/work/hot/hotrails/vendor/gems/mislav-will_paginate-2.3.11/lib/will_paginate/finder.rb:170:in `method_missing' from /home/cjk/work/hot/hotrails/app/models/user.rb:2 from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:380:in `load_without_new_constant_marking' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:380:in `load_file' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:379:in `load_file' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:259:in `require_or_load' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:425:in `load_missing_constant' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `const_missing' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:92:in `const_missing' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/inflector.rb:361:in `constantize' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/inflector.rb:360:in `each' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/inflector.rb:360:in `constantize' from /usr/lib/ruby/gems/1.8/gems/activesupport-2.3.4/lib/active_support/core_ext/string/inflections.rb:162:in `constantize' from /home/cjk/work/hot/hotrails/vendor/gems/devise-0.5.5/lib/devise/mapping.rb:80:in `to'...
Please try running the devise_example at http://github.com/plataformatec/devise_example.
>Can you send us your ruby version, rails and gems/plugins? Somone is messing up with Rails load process along the way.
ruby 1.8.7 (2009-06-12 patchlevel 174) [x86_64-linux]
Rails is v2.3.4
Gems/plugins from environment.rb:
... config.gem "warden" config.gem "devise"
config.gem 'mislav-will_paginate', :version => '~> 2.3.8', :lib => 'will_paginate', :source => 'http://gems.github.com' config.gem "rich-acts_as_revisable", :lib => "acts_as_revisable", :source => "http://gems.github.com"
config.gem "zilkey-active_api", :lib => "active_api", :source => "http://gems.github.com"
config.plugins = [ :haml, :state_machine, :"thinking-sphinx", :"acts-as-importable" ] ...
Finally, could you please ensure that a init.rb is in your gem/plugin root folder?
There is an init.rb in vendor/gems/devise-0.5.5/
Thanks a lot for your help so far.
Well, the devise_example app is running fine.
Though it's using different versions of warden / devise - could this make a difference?
Update: When I disable all my plugins (not gems) it starts working!
I tracked it further down to the thinking-sphinx plugin. But once I install all my plugins as gems, it works as well!
Even the load-order seems to make a difference.
Anyway, I'll need to analyse this further and so far it seems like devise is not the cause, but perhaps a symptom.
Thanks again for your support on this issue, please consider it solved so far.
I have a similar issue whereby I am requiring warden in a sinatra app and getting "NameError: uninitialized constant Warden".
I am doing:
require 'rubygems' require 'sinatra/base' require 'warden' class Warden::Serializers::Session def serialize(user) user.id end def deserialize(key) User.get(key) end endiq,
not sure how warden and sinatra are supposed to get along.
I fixed my problem by changing the order of the required gems and get rid of all plugins (applies to Rails only).
If that doesn't work for you, you could try to add extra 'require ...' statements in devise where needed, as perhaps sinatra does autoloading different from Rails.
good luck,
Claus
Thanks Claus, the only way I could get around it was to manually require all parts of warden i.e:
require 'warden' require 'forwardable' require 'warden/mixins/common' require 'warden/proxy' require 'warden/manager' require 'warden/errors' require 'warden/strategies' require 'warden/strategies/base' require 'warden/serializers' require 'warden/serializers/base' require 'warden/serializers/cookie' require 'warden/serializers/session' -
Hello,
when trying do run an application using devise on heroku (www.heroku.com) I seem to be having some problems, namely with the controller "confirmations", action "show" (when I go to confirm a password in an email).NoMethodError (undefined method `one?' for #«Array:0x2ac12c27d860»): devise (0.5.4) lib/devise/controllers/filters.rb:129:in `sign_in_and_redirect' devise (0.5.4) app/controllers/confirmations_controller.rb:27:in `show' warden (0.6.3) lib/warden/manager.rb:84:in `call' warden (0.6.3) lib/warden/manager.rb:83:in `catch' warden (0.6.3) lib/warden/manager.rb:83:in `call' /home/heroku_rack/lib/static_assets.rb:9:in `call' /home/heroku_rack/lib/last_access.rb:25:in `call' /home/heroku_rack/lib/date_header.rb:14:in `call'
As I gather, the problem seems to be that heroku is using ruby version 1.8.6
http://docs.heroku.com/technologieswhich apparently doesn't support the Enumerable::one? method.
Maybe if this method call could be replaced with something else, not just for heroku, but backwards compatibility with 1.8.6 in general, it's still a widely used ruby version.
Thanks,
Tomislav CarComments
-
Perhaps this would allow subclassing Devise controllers in order to override their default methods. For example, suppose we wanted the
SessionsController#destroyaction to redirect to theadmin_root_pathrather than theroot_path. We would then want to create theapp/controllers/sessions_controller.rbfile like so:class SessionsController < Devise::SessionsController def destroy set_flash_message :success, :signed_out if signed_in?(resource_name) sign_out(resource_name) redirect_to admin_root_path end endOr is there some other way to override the default
SessionsControllerbehavior?Comments
carlosantoniodasilva
Thu Nov 19 02:18:18 -0800 2009
| link
Right now you're able to change the behavior of redirects using an admin_root_path instead of root_path like your example. Devise will always look for a namespaced route before redirecting to root_path. This just works while signing a user in, reseting his password or confirming his account. However, after destroying a user the redirect will always be to root_path. Do you fell you'll need to change any other default behavior besides this?
Perhaps we can create a way to overwrite the redirect to root_path while signing a user out, as a specific route. What do you think?Ok, right now, if you need to configure the sign out path, just overwrite the after_sign_out_path_for in your ApplicationController. Closing!
logicaltext
Thu Nov 19 07:29:38 -0800 2009
| link
@carlosantoniodasilva: Yes, I would like to change the behavior if possible. In my application, it makes sense for a user to be redirected to the "real"
root_path, i.e., the home page of the public-facing application, but I would like admins to get redirected to their own "backend" home page, i.e.,admin_root_path. In fact, maybe the answer is to change the last line ofSessionsController#destroyto:redirect_back_or_to home_or_root_pathas is used in
SessionsController#create. Would that have any unwanted side effects?@josevalim: Thanks for the tip, but I'm afraid I don't understand how to do this. First, I couldn't find this variable anywhere in Devise--is it a hook? And second, what would the syntax be? Sorry if it's a stupid question!
This is a hook just added to Devise. Install devise 0.5.4 and do in your application controller:
def after_sign_out_path_for(resource_or_scope) case resource_or_scope when :admin, Admin your_special_path else root_path end endJust replace your_special_path with the path you want and that should do the trick!
logicaltext
Thu Nov 19 07:43:40 -0800 2009
| link
@josevalim: Thanks for such a quick fix! That's just what I needed.
-
The password is required in all updates. But if i want change only the email?
maybe a :allow_blank in validate_presence_of :password solve.
Comments
Devise already handles that:
http://github.com/plataformatec/devise/blob/master/lib/devise/models/validatable.rb#L36
If you don't want to validate password, ensure that password attributes are discarded if they are blank or use two forms: one for updating attributes and other for updating password as in devise_example.
-
Add friendly_token function to a core module or the base User class
2 comments Created about 1 month ago by aaronchiI used to use this function separately with authlogic. It could be referenced with Authlogic::Random.friendly_token
It would be nice if you could do the same for devise so you could reuse this function in other places if you wanted to.
Comments
-
I am setting up a site where I want all my users to sign in on their appropriate subdomain. I would like to use the following in my routes:
map.with_options :conditions => { :subdomain => /.+/ } do |workplace| workplace.devise_for :employees endWhen I do use that I get an error that it doesn't know about the conditions key. anyway I can do something similar?
Comments
That was supposed to work, try doing some debug on devise/rails/routes.rb
It would but Mapping.initialize has:
options.assert_valid_keys(:class_name, :as, :path_names, :singular, :path_prefix)which kicks back that :conditions isn't valid
Awesome! I'm closing now, expect a new release in the next week!
carlosantoniodasilva
Fri Nov 13 02:53:53 -0800 2009
| link
Hello, could you please try updating your plugin and see if everything is still working?
I've made some changes to ensure options (ie :conditions) are passed to devise routes, so in your scenario, employees will only be able to sign in inside a subdomain, and not the root domain. -
I've attempted to use devise along side jnunemaker's mongo_mapper and I continue to run into an issue where my model:
class User
include MongoMapper::Document devise :all endresults in:
method_missing :NoMethodError: undefined method 'devise_modules' for User:ClassAny hints on how to get it to properly extend Devise::Models ? My ruby meta-fu is weak!
Comments
We have no support for MongoMapper yet. I would suggest you to ask in the mailing list, there are some folks there working on it.
Hi, I use Devise with CouchRest successfully. I think it will be the same situation here so you just need to extend your class using
extend Devise::Models.Jose Valim: Are you interesting in a devise example app with CouchRest? I'm able to make it. :)
Please do! We are going to support mutliple ORMs, the more examples, the best! Are you following our mailing list?
http://groups.google.com/group/plataformatec-devise
Thanks!
-
Booting app with Devise and Bundler failed
8 comments Created about 1 month ago by deepjI'm getting this error with Devise and Bundler. If I run app without Devise, it is okay.
root@ROOT:/c/dev/MUNI/Bakalarka/portfonica$ ruby script/server => Booting Mongrel => Rails 2.3.4 application starting on http://0.0.0.0:3000 c:/dev/MUNI/Bakalarka/portfonica/gems/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:440:in `rescue in load_missing_constant': uninitialized constant Controllers::Filters (NameError) from c:/dev/MUNI/Bakalarka/portfonica/gems/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:436:in `load_missing_constant' from c:/dev/MUNI/Bakalarka/portfonica/gems/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:80:in `const_missing_with_dependencies' from c:/dev/MUNI/Bakalarka/portfonica/gems/gems/devise-0.4.3/lib/devise/rails/routes.rb:10:in `load_routes_with_devise!' from c:/dev/MUNI/Bakalarka/portfonica/gems/gems/actionpack-2.3.4/lib/action_controller/routing/route_set.rb:266:in `load!' from c:/dev/MUNI/Bakalarka/portfonica/gems/gems/rails-2.3.4/lib/initializer.rb:537:in `initialize_routing' from c:/dev/MUNI/Bakalarka/portfonica/gems/gems/rails-2.3.4/lib/initializer.rb:188:in `process' from c:/dev/MUNI/Bakalarka/portfonica/gems/gems/rails-2.3.4/lib/initializer.rb:113:in `run' from c:/dev/MUNI/Bakalarka/portfonica/config/environment.rb:5:in `' from c:/dev/MUNI/Bakalarka/portfonica/gems/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from c:/dev/MUNI/Bakalarka/portfonica/gems/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `block in require' from c:/dev/MUNI/Bakalarka/portfonica/gems/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in' from c:/dev/MUNI/Bakalarka/portfonica/gems/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:156:in `require' from c:/dev/MUNI/Bakalarka/portfonica/gems/gems/rails-2.3.4/lib/commands/server.rb:84:in `' from script/server:3:in `require' from script/server:3:in `' root@ROOT:/c/dev/MUNI/Bakalarka/portfonica$
My settings is here:
http://github.com/wycats/bundler/issues#issue/88I declared nothing Devise anywhere. No configuration in environment.rb or used an initializer. I just specified it in my Gemfile.
Comments
Devise relies on Rails require_dependency, which bundler does not use. require_dependency knows that Devise::Controllers::Filters is available at "devise/controllers/filter" and loads that file automatically. Using bundler, that file cannot be loaded and should be required manually.
After a talk with Yehuda, we agreed that the bundler preinitializer for Rails 2.3 needs to be improved, something along those lines might make it work:
require "#{File.dirname(__FILE__)}/../vendor/bundler_gems/environment" Gem.loaded_specs.values.each do |spec| require_dependency File.expand_path("lib", spec.full_gem_path) init = File.expand_path("init", spec.full_gem_path) require init if File.exists?(init) endI've tried the code and it failed on:
c:\dev\MUNI\Bakalarka\portfonica>ruby script\server c:/dev/MUNI/Bakalarka/portfonica/config/../config/preinitializer.rb:6:in `block in ': undefined method `require_dependency' for main:Object (NoMethodError) from c:/dev/MUNI/Bakalarka/portfonica/config/../config/preinitializer.rb:5:in `each' from c:/dev/MUNI/Bakalarka/portfonica/config/../config/preinitializer.rb:5:in `' from c:/dev/MUNI/Bakalarka/portfonica/config/boot.rb:28:in `load' from c:/dev/MUNI/Bakalarka/portfonica/config/boot.rb:28:in `preinitialize' from c:/dev/MUNI/Bakalarka/portfonica/config/boot.rb:10:in `boot!' from c:/dev/MUNI/Bakalarka/portfonica/config/boot.rb:110:in `' from script/server:2:in `require' from script/server:2:in `'It has not helped, it returns the same problem like in my first report.
But It is okay. It seems to be a problem in Bundler, so sorry for reporting here :).
No problem. Just one more try. Instead of "require_dependency" try "ActiveSupport::Dependencies.require_dependency" or simple adding it to load path "ActiveSupport::Dependencies.load_path <<".
pacoguzman
Sat Dec 19 02:49:09 -0800 2009
| link
Hi!
I'm in the same problem, my configuration is the following:
boot.rb (at the end) # To run with passengerclass Rails::Boot
def runload_initializer extend_environment Rails::Initializer.run(:set_load_path)end
def extend_environment
Rails::Initializer.class_eval do old_load = instance_method(:load_environment) define_method(:load_environment) do Bundler.require_env RAILS_ENV old_load.bind(self).call end endend end
preinitializer.rb
require "#{RAILS_ROOT}/vendor/bundled_gems/environment"
And I'm tried all your options but nothings happens, I've received the following errror:
undefined method
devise' for #<Class:0x7fb972d37448><br/> /home/pacoguzman/dev/my_github/tmp/devise/vendor/bundled_gems/gems/activerecord-2.3.5/lib/active_record/base.rb:1959:inmethod_missing' /home/pacoguzman/dev/my_github/tmp/devise/app/models/user.rb:2Thanks
I just noticed the code above was wrong, here is the proper version:
require "#{File.dirname(FILE)}/../vendor/bundler_gems/environment"
Gem.loaded_specs.values.each do |spec|
require_dependency File.expand_path("lib", spec.full_gem_path) init = File.expand_path("init", spec.full_gem_path) require init if File.exists?("#{init}.rb") endIf this does not work, try doing require "devise" in your initializer/preinitializer. If that does not work, I do not know how to help any longer. This is more a bundler issue though.
-
Wishlist - Pretty URL for verification path and reset password path
2 comments Created about 1 month ago by KeytwoIt would be nice to have pretty URL for recoverable and confirmable strategies routes.
As is:
"/users/verification?confirmation_token=MyHash"Nice to have:
"/users/verification/MyHash"so that confirmation_token is passed in route as param:
"/users/verification/:confirmation_token {:controller=>"users", :action=>"index"}"Something like:
"map.connect 'users/verification/:confirmation_token', :controller => 'users'"I don't know how to obtain this, or even if it is possible.
What do you think?
Comments
You should be able to obtain that declaring a named route after devise_for:
map.user_confirmation '/users/confirmation/:confirmation_token', :controller => 'confirmations', :action => 'show'
-
Hey José,
Here comes the issue for your records.
Feature description: It would be nice to add support for encryptions of different solutions to allow people to migrate production applications to Devise.
Here's my implementation: http://github.com/mhfs/devise/
Currently supporting Clearance, Authlogic and Restful-Authentication.
Discussion in mailing list: http://groups.google.com/group/plataformatec-devise/browse_thread/thread/fb9c7f6b5bc02959
Thanks,
MarceloComments
-
the exception ActiveRecord::RecordNotFound is shown when the register no more exist. and should redirect to login page.
FIX:
The following changes since commit 05678e7:
José Valim (1):Added support to config.default_url_options.are available in the git repository at:
git@github.com:ramon/devise.git master
Ramon Soares (2):
fix record not found failure in recovery session failure_app logout with scope nowlib/devise/failure.rb | 2 ++ lib/devise/warden.rb | 6 +++++- 2 files changed, 7 insertions(+), 1 deletions(-)
Comments
-
script/generate devise_install not working
11 comments Created about 1 month ago by mneisenHi everyone,
I installed the latest devise gem (0.4.1) but script/generate devise_install results in the following error:
$ script/generate devise_install Couldn't find 'devise_install' generatorI wonder whether this is only a problem on my side, or if the generator is missing from the gem ...?
Best regards
Martin EisenhardtComments
I just tried in my computer, using Devise 0.4.2:
rails foo cd foo script/generate devise_installAnd it worked. It was supposed to work on devise 0.4.1 as well, but try upgrading it to check if it's broken for you or on 0.4.2 as well.
Hi Jose,
thanks for the quick reaction.
Sadly, upgrading to 0.4.2 did not resolve the problem:
$ rails foo && cd foo $ script/generate devise_install Couldn't find 'devise_install' generatorSorry for the inconvenience ...
This is quite odd that it's not working. Which rails are you using? (It won't work with Rails 3/edge...)
I am using
- Devise 0.4.2
- Warden 0.5.1
- Rails 2.3.4
- ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9]
- MacOS X 10.5.8
I do not use Rails Edge or Rails 3 ( I am not that fancy ... :-D )
BTW: If this only affects me, then please do not bother. Devise is a great piece of code, and you should invest your time into perfecting and extending it.
carlosantoniodasilva
Sun Nov 08 15:02:54 -0800 2009
| link
Hello,
I've also tried it here the same way you did:
rails foo && cd foo script/generate devise_installAnd everything is fine.. Have you already tried adding warden and devise to your config.gem before running "script/generate devise_install"?
Hi Carlos,
yes, the config.gem lines are in my environment.rb. Devise as such is working, I am able to login and manage user data. It is just that I cannot use the generator to create the devise initializer like everybody else seems to do ... :-(
carlosantoniodasilva
Mon Nov 09 02:14:54 -0800 2009
| link
It seems odd... as we can't reproduce here.. are all others Devise generators working fine?
I know it is odd. I even removed the gems (Warden and Devise) and re-installed them. And yes, all other generators work fine, including
script/generate devise UserThanks!
Hi everyone, I just scrapped all my gems and reinstalled them via the corresponding rake task. Suddenly, everything works fine.
Strange, but not unwelcomed ... :-D
Thanks for your time, anyway!
carlosantoniodasilva
Mon Nov 09 04:24:22 -0800 2009
| link
Great it's working now!
You're welcome..
Closing.... -
Devise is not compabile with Rails 3 callbacks
5 comments Created about 1 month ago by deepjHi,
I'm using Devise with CouchRest and I would like use Confirmable mixin in my ExtendedDocument. Unfortunately, it fails because CouchRest uses callbacks from Rails 3 and Devise just is compatible with Rails 2 callbacks :(Comments
Hey, I think there are other thing that won't work on Rails 3 as well, as routes definition.
I worked on Rails 3 callbacks, so in theory, the API should be the same. Which error are you getting?
Hi,
maybe I wasn't clear, sorry. CouchRest uses Rails 3 callbacks:
http://github.com/mattetti/couchrest/blob/master/lib/couchrest/mixins/callbacks.rbI'm using Rails 2.3 with CouchRest and Devise. My code fails on before_create method which is calling inside Models::Confirmable mixin. CouchRest uses Rails 3 callback such as create_callback :before instead. But I did a hack using own mixin which makes a bridge between those callbacks without broken Devise or CouchRest code.
Understood ;) I would suggest you to define and after_create and before_create callbacks (which I think you already done), so everything should work as expected. :)
Thanks your advice, but you need to define those callbacks before including Devise::Models::Confirmable mixin. :)
-
Perhaps these are all valid, but this seems to lack clarity as to how the email sender should be set. Here are three different stated ways that the sender can be set...
On command line after "script/generate devise Model"...
Setup default sender for mails.In config/environment.rb: Notifier.sender = "test@example.com"README - development environment
DeviseMailer.sender = "no-reply@yourapp.com"initializers/devise.rb after "script/generate devise_install"
config.mail_sender = "foo.bar@yourapp.com"Best Regards,
David BaldwinComments
Notifier.sender is invalid (I will fix it). The other to are valid, but I think the last one should be renamed to config.mailer_sender. Wdyt?
baldwindavid
Fri Nov 06 08:35:23 -0800 2009
| link
Perfect.
-
Devise::Controllers::Helpers.home_or_root_path should accept :path_prefix
8 comments Created 2 months ago by KeytwoThis kind of route will break url_for parser in topic function:
map.user_root 'admin/dashboard', :controller => 'admin/dashboard', :path_prefix => '/:locale'Comments
Even if you set the locale in default_url_options?
def default_url_options { :locale => I18n.locale } endYes, same result.
One strange thing (maybe due to a redirect) is that if you F5 the page the problem doesn't reproduce.Ok, so in order to fix that, could you please fork devise_example at github.com/plataformatec/devise_example and explain me what I need to do to reproduce the error?
I was able to get it working on devise_example. I defined:
map.user_root 'admin/dashboard', :controller => 'admin/dashboard', :path_prefix => '/:locale'
And then in my application controller:
def default_url_options
{ :locale => I18n.locale } endI will have a check and let you know as soon as possible ;)
Hi, Jose, It was my mistake!
instead of simply usinglink_to "Dashboard", user_root_pathI was passing an additional argument (I18n.locale) to the path:link_to "Dashboard", user_root_path(I18n.locale)I'm sorry
Keep doing the good work ;)
Anyway I found this:
https://rails.lighthouseapp.com/projects/8994/tickets/1251-default_url_options-cant-be-used-with-named-routesI think my issue was referable to the linked topic, I was trying to do something that isn't supported yet ;)
Bye
-
ruby script/generate devise Model
rake db:migrateemail field not created in the database;
rake aborted!
Mysql::Error: Key column 'email' doesn't exist in table: CREATE UNIQUE INDEX `index_Comments
Please update your migration to use t.authenticatable instead of t.authenticable. There was a version with deprecations, I guess you missed it.
Actually, now I realized that the migration in generator was outdated. Already fixed. Please reinstall devise 0.4.1. Thanks!
-
0.4.0 migration t.authenticable needs to be changed to t.authenticatable
1 comment Created 2 months ago by manalang -
If you use the devise.rb initializer and enable the commented out options, script/generate fails. Here's a stack trace:
script/generate
/Users/rich/dev/42rooms/config/initializers/devise.rb:6: undefined method `pepper=' for Devise:Module (NoMethodError)from /Users/rich/dev/42rooms/vendor/gems/devise-0.4.0/lib/devise.rb:18:in `setup' from /Users/rich/dev/42rooms/config/initializers/devise.rb:3 from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in `load_without_new_constant_marking' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in `load' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:521:in `new_constants_in' from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:145:in `load' from /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:622:in `load_application_initializers' from /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:621:in `each' from /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:621:in `load_application_initializers' from /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:176:in `process' from /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send' from /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run' from /Users/rich/dev/42rooms/config/environment.rb:4 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from /Library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/commands/generate.rb:1 from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require' from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require' from script/generate:3Comments
-
Comments
-
Wishlist: Enter existing password to create a new one
8 comments Created 2 months ago by gavinhughesIt's the right way to do it. And it's just a wish... :)
Comments
Sorry Gavin, but it's not clear for me. You want a method that does it? A view?
gavinhughes
Tue Nov 03 03:02:06 -0800 2009
| link
José, what I was trying to say is that it would be nice if Devise offered this right out of the box:
Old password:
New password:
Confirm new password:If we provide that as view, you would probably need to customize it anyway. I think the only reusable piece would be a method to be used in your controllers. Something like update_with_password. Wdyt?
gavinhughes
Tue Nov 03 03:17:21 -0800 2009
| link
From a consumer's point of view, I think it would look good like this:
In Devise.config:
password_update_requires_old_password = trueThen in the view:
:old_password :new_password :new_password_confirmationHow's that look?
+1 for current password validation. This is a security issue, no one should be able to change password if user forgot to lock workstation on coffee break.
meskyanichi
Sat Nov 21 16:50:36 -0800 2009
| link
I agree to be honest. Would be nice since this is something you probably want to do in (almost) every application. Would be nasty if someone somehow XSS's a session and changes the password of an account. Of course, the developer of the app would be at fault for allows XSS to happen. But yeah, regardless, I believe adding that as a "module" or "add-on", as mentioned above, to be able to handle this would be a nice addition.
carlosantoniodasilva
Mon Dec 14 17:10:31 -0800 2009
| link
Added update_with_password, so you are able to update the password only when the :old_password is valid. Create a form like this:
form_for @user, :url => update_password_path do |f| f.label :old_password f.password_field :old_password f.label :password f.password_field :password f.label :password_confirmation f.password_field :password_confirmation endAnd use in your controller:
@user.update_with_password(params[:user])
Closing.
-
I'm getting the following when trying to create a new user:
NoMethodError (undefined method `find_template' for []:Array): devise (0.3.0) lib/devise/models/confirmable.rb:59:in `send_confirmation_instructions'Comments
Are you able to reproduce this error in the devise example app (http://github.com/plataformatec/devise_example)?
moved
Notifier.sender = "no-reply@yourapp.com"into its own initializer and confirmation email is working as described
This odd. :/ Anyway, I'm closing the ticket right now, since I could not reproduce.
baldwindavid
Mon Nov 02 19:59:06 -0800 2009
| link
I received the same error and fixed by moving the Notifier.sender to an initializer
-
Devise example should have a sign up form as example
14 comments Created 2 months ago by josevalim(Requested by Martin Eisenhardt in the mailing list)
Comments
baldwindavid
Mon Nov 02 08:31:42 -0800 2009
| link
I think that new user creation has already been decided to be placed outside Devise. However, just my two cents that it may help for quick adoption if it included User registration and creation out of the box. It could still be modular.
For example, most of my apps either have open registration or are created by an admin. Either way, the user always has the ability to manage their account through the edit and update actions. Something like below would allow picking and choosing the user creation process. I certainly agree that this is variable per app and would often be overridden, but this would be a nice way to achieve the instant authentication setup that Clearance has (not overlooking that this already has a lot that Clearance does not have). Just a thought.
Registerable
This would allow anyone to register for the site - Public registration
Controller: UsersController (or ManagersController, etc.)
Actions: new, createAccountable
This would allow users to manage only the details of their account. The account could have been created via public registration or creation by an administrator
Controller: UsersController
Actions: edit, updateManageable
This would allow admins, managers, etc. to manage users with all actions available
Controller: Admin::UsersController (perhaps the namespace and type of user they could manage would be configurable)
Actions: allSince we use Inherited Resources (http://github.com/josevalim/inherited_resources) in all our projects, creating a sign up, edit and destroy actions is simple creating a controller which inherits from it.
We want to avoid controller configuration in devise the maximum we can and it's hard to imagine a sign up process that does not require developer configuration at all.
baldwindavid
Mon Nov 02 09:58:39 -0800 2009
| link
Yes, I love inherited_resources and use it or resource_controller. Agreed that it is not difficult to create these, but mention it only as a way for people new to Devise to have a quick fully-functional auth system. I can certainly appreciate wanting to keep this sort of thing out of Devise core though.
Me too totally agreed coz couple of days ago, I gave the Devise a shot and confused a little bit searching for the signup form!
Is there any WIP?And yet once you create that controller and couple of views for sign up form you realize that what you're missing most is sign_in helper for functional tests. I'd rather suggest focus was on the helper instead. In fact I just added sign_up form and made pull request, hopefully it will be committed soon.
Hi, maxim
Is your request pulled??
If not, have you pushed to somewhere else, maybe your fork or something? Then can you point to some commit so that I can use this signup form??wnn,
Looks like it hasn't been pulled yet, but feel free to use my fork at http://github.com/maxim/devise_example. The whole signup form functionality is in one last commit.
trevorturk
Sun Nov 08 09:11:00 -0800 2009
| link
I agree that having a sign up example would be great, even if it's almost certainly not going to be used in the long run.
@maxim, I pulled your patch and now the user signup works. Just a small note that when the Remember Me is checked, I got the error:
NoMethodError in SessionsController#destroy
undefined method `remember_created_at=' for #<User:0xb3ccc14>
So, I got to add that column in migration:
add_column :users, :remember_created_at, :datetime
to make it work with Remember Me checkbox.
Devise is an authentication solution, please don't add any registration and inherited_resources to it.
Relax, this is just an example of user creation. This issue can now be closed and the test helpers can be upvoted. :P
-
yml messages cannot be configured when using yml from engines
1 comment Created 2 months ago by josevalim -
The current update email process needs some love. I suggest:
Given I am signed in
When I update my email address
Then a confirmation email should be sent
And I should be on my account page
And I should see a message "A confirmation email has been sent to your new email address. Your old email address, {resource.email}, is still active until you confirm the new one."
When I follow the link in the confirmation email
Then I should be on my account page
And I should see a message "Your email address has been confirmed."
This is a bit more complicated, but I think it's best practice. The User model will need a :pending_email attribute. You could go a bit further and add something like this in a Devise-generated resource show view:
-if resource.pending_email You have requested to change your email address to {resource.pending_email}. An email has been sent there to make sure it is a valid address. = link_to 'Resend confirmation email', ... = link_to 'Cancel request', ...
Having all this by right out the box would be beautiful!
Comments
gavinhughes
Thu Oct 29 14:48:48 -0700 2009
| link
A little munched up by Markdown, but you get the idea... :)
Ok, I will break this history in the following tasks:
1) Do not show say in the message "confirmation period finished" if no period is set.
2) Show after sign in, how many time you have to confirm your account.
3) When you change your email, the old e-mail should be stored in pending_email and the user should not be logged out.Thanks Gavin!
By @gavinhughes:
"I would skip step 2. Non-standard and too much information for the user. Instead, make the default confirmation time limit 1 week and then have the time limit configurable in an initializer."
Ok, no step 2 then! All model configurations can also be done in an initializer:
devise :all, :confirm_in => 1.week
Can also be done globally as:
Devise.confirm_in = 1.week
By the way Gavin, the problem you have when an user changes its e-mail and he's automatically logged out just happens when using confirmable and confirm_in is equals to 0.
gavinhughes
Thu Oct 29 20:59:03 -0700 2009
| link
Nice! But should be :confirm_within
Ok, changed to :confirm_within and the message does not mention the confirmation period anymore.
After some discussion with the guys here, we decided to remove e-mail confirmation when the user changes his e-mail but already signed in and confirmed his account. We looked to Basecamp, Highrise and Facebook settings and none of them send you an confirmation e-mail when you change your old e-mail to a new one.
-
Isn't the word "authenticatable" rather than "authenticable". I'm not sure authenticable is actually a word. Maybe that is how everyone thinks it is spelled so it doesn't matter.
Best Regards,
David BaldwinComments
Hey David! You are right and "authenticable" is probably a common typo. A search on Google shows 16.000 results for it against 24.000 results for "authenticatable". :)
We are going to change it during this week! :) Thanks!
Fixed! We are going to adopt the verb in the infinitive + able as the default rule to get names:
- to authenticate + able = authenticatable
- to confirm + able = confirmable
- to recover + able = recoverable
Thanks again.
baldwindavid
Fri Oct 30 07:35:09 -0700 2009
| link
Great. That was quick!
-
Store and redirect to a requested url *and* present a custom flash
1 comment Created 2 months ago by gavinhughesNeed mechanism to store and redirect to a requested url and present a custom flash as describe in the scenario below. The first can be done with #authenticate_user! and the second with before_filter :set_flash_and_redirect_to_sign_in, but both are not currently possible.
Given I am a guest
When I follow "Create Post"
I should be on the new user session page
And I should see a message "Please sign in or sign up to create a post"
When I sign in
I should be on the new post pageComments
-
It would be nice to have something like "last_login_at" and "last_login_from" (client IP) in User model or a hook or a filter in the session controller that allows to populate them prperly.
Thanks in advance
Comments
-
No errors returned on the resource when validations fail in SessionsController
2 comments Created 2 months ago by gavinhughes -
NoMethodError on reset password instructions
2 comments Created 2 months ago by masterkainplease see http://pastie.org/672974 for further informations
Comments
masterkain
Tue Oct 27 23:50:16 -0700 2009
| link
oh I forgot, of course no problems using:
map.devise_for :operators
in routes -
Need access to SessionsController to specify things like layout
6 comments Created 2 months ago by gavinhughesnt
Comments
If you want to specify layout, you can do that in an initialiazer or somewhere else:
SessionsController.layout :my_special_layout
This how Rails Engines work, so it's a design decision as well. :)
Is it acceptable to make a layout to be configurable like other devise options? Strange thing actually, where is a right place to set SessionController.layout? I am getting an error when it in warden initializer or in an environment.rb
SessionsController should be accessible from initializer or environment, there is no need to wrap that in Devise API if you can access it directly. Be sure that you don't have a type there (you gave me SessionController).
-
Need mechanism to create instance variables in SessionsController.
1 comment Created 2 months ago by gavinhughesFor example, an app that has two forms 'Sign in' and 'Sign up' in the sessions/new view. This view requires the @user instance variable. Currently, Devise has no mechanism to create this. It appears the best we to handle this is to create a generator to add a SessionsController to the app in the same way that we generate the sessions views. Other ideas?
Comments
-
Everything was working great in a previous version of Devise but when I upgraded to 0.2.0 authentic_user! now locks up the rails app if the user isn't logged in. Basically what appears to happen is the browser sees the redirect to /users/sign_in?unauthenticated=true and then the app stops responding until it's restarted. When I restart the app I can hit that url directly and login just fine. I suspect the problem is with Warden because Rails isn't outputting anything. Any thoughts? Anybody else seen this issue?
Comments
Samuel, our devise_example (http://github.com/plataformatec/devise_example) works fine. Are you able to reproduce the failure in a raw application?
samueldean
Tue Oct 27 13:36:42 -0700 2009
| link
Devise_example is still using version 0.5.0 of Warden and 0.1.0 of Devise. When I changed the gem versions to 0.5.1 and 0.2.0 I see the same behavior.
gavinhughes
Tue Oct 27 13:57:12 -0700 2009
| link
I replicated this bug on the vanilla app shown in the Devise tutorial using Mongrel 1.1.5. When I start the same app using Thin 1.2.4, it works fine. Samuel, what server are you using?
samueldean
Tue Oct 27 13:59:12 -0700 2009
| link
I'm using Mongrel 1.1.4.
Just updated devise example. Could not reproduce the error on devise_example with Rails 2.3.4, Rack 1.0.0, Warden 0.5.1, Devise 0.2.0 and Mongrel 1.1.5 (started with script/server mongrel).
samueldean
Tue Oct 27 14:41:41 -0700 2009
| link
José, after you db:create, db:migrate and ./script/server are you hitting /admins before logging in? If I just use the normal sign in and sign out methods everything works fine. It's only when I hit authenticate_admin! or authenticate_user! and I'm not logged in that I see it lock up.
samueldean
Tue Oct 27 14:43:09 -0700 2009
| link
FYI - I upgrade Mongrel to 1.1.5, but all of the other software is the same. I'm using the default Ruby 1.8.6 on Mac OS X Leopard.
I've redone the steps above and could not verify the error again. I'm using Ruby 1.8.7 on Ubuntu. Maybe it's the ruby version?
gavinhughes
Tue Oct 27 14:48:43 -0700 2009
| link
Could be Ruby. I'm on 1.8.6. Samuel, have you tried serving with Thin?
samueldean
Tue Oct 27 15:34:02 -0700 2009
| link
@gavinhughes - It works fine in Thin. Thanks for thinking of that. It's easier than upgrading to 1.8.7. :)
@josevalim - It's looking like a bad interaction with 1.8.6, Devise and/or Warden and certain Rack servers. Thin and 1.8.6 works. Mongrel and 1.8.6 doesn't. When I deploy to Passenger and REE 1.8.6 I get premature end of script headers in strange places. I'm thinking this is really more of a Warden/Rack issue, but not sure where to begin.
plataformatec
Tue Oct 27 15:45:15 -0700 2009
| link
I think I know what it is. Could you change the following line in your lib/devise/failure.rb:
[302, headers, message]
To:
[302, headers, [message]]
And tell me how that works for you? (this line is this one: http://github.com/plataformatec/devise/blob/master/lib/devise/failure.rb#L26)
José Valim
samueldean
Tue Oct 27 15:52:55 -0700 2009
| link
That definitely fixes it on Mongrel and 1.8.6!
-
undefined method `mappings' for Devise:Module (NoMethodError)
2 comments Created 2 months ago by kivanioscript/generate formtastic
/Library/Ruby/Gems/1.8/gems/devise-0.1.0/lib/devise/controllers/filters.rb:72: undefined method `mappings' for Devise:Module (NoMethodError)from /Library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencies.rb:380:in `load_without_new_constant_marking'Comments
carlosantoniodasilva
Sat Oct 24 14:23:35 -0700 2009
| link
Hello Kivanio, I'm closing this ok.
-
STI Issue: If User inherits from Person then a Person can't be saved
1 comment Created 2 months ago by gavinhughesIf User inherits from People, a Person can't be saved because devise adds :null => false on several User attributes, which are only for User, not Person. Removing :null => false works fine.
Comments
-
When I add additional fields in my User model they get completely ignored. I tried creating a new project and using an Account model but the same thing happened. Am I missing something obvious?
Comments
Please remember to allow them with attr_accessible.
I'm going to add it to the README.
samueldean
Thu Oct 22 08:59:52 -0700 2009
| link
Thanks for the quick response! I did that and it worked. I don't understand why it behaves differently than a normal rails ActiveRecord object though.
It behaves differently because we use attr_accessible inside Devise to protect the attributes. Maybe we shouldn't?
samueldean
Thu Oct 22 09:21:32 -0700 2009
| link
I definitely think it's important to protect certain variables from mass assignment, but I guess my personal preference is a black list instead of a white list. It just feels more rails like and it feels weird to put attr_accessible for all variables when other models don't work that way. That's all personal opinion of course and everything else feels much more rails like than any other authentication plugin I've used. I really liked Auth Logic at first but I felt like it added a ton of code to my app and every new app required tons of copy/paste/test. I can already tell I don't have that issue with Devise so thank you!
Funny, because we always use attr_accessible instead of attr_protected. So I just documented it in the README. :) Thanks!
-
uninitialized constant Devise::Strategies (NameError)
4 comments Created 2 months ago by mczepielfrom .... /devise-0.1.1/lib/devise/warden.rb:60
Happening with Rails 2.3.4 Devise 0.1.1
I am using the gem bundler stuff but it seems like it's loaded what I'd expect, there's just no Devise::StrategiesAm I missing something to get that module loaded? Am I supposed to manually require those files from the devise lib?
Comments
Hey mate, could you try to add:
require 'devise/strategies/base'
On your bundled gem on lib/devise/warden.rb at line 59 and tell us how it works for you?
Thanks!
Sorry tried that myself very late last night to no avail.
uninitialized constant Devise::Strategies::Rememberable
Every time I require a class its missing, it pretty much fails on the next dependency. I'll have to try building a gem of your most recent build seeing as you've had a lot of activity today.
-
Installing Devise in an empty Rails 2.3.4 app breaks rake routes task and script/*
4 comments Created 2 months ago by shanesvellerI have generated an empty Rails 2.3.4 app using PostgreSQL. After adding the exact same config.gem statements from the example devise app, some rake tasks and most of the script/* files are broken. I've created a gist with any relevant info I could think of. Please let me know if you'd like me to try anything or provide other information.
Comments
shanesveller
Wed Oct 21 09:40:56 -0700 2009
| link
It's worth noting than side-by-side on the same development machine, these commands all seem to work flawlessly within the directory for the devise_example app as of plataformatec/devise_example@cb661bd .
carlosantoniodasilva
Wed Oct 21 10:18:53 -0700 2009
| link
Hello,
we've reviewed the loading process of Devise and it was a problem while requiring the mapping module. Also we added some info in README to help you creating a default root route and configuring url options for the mailer.
The bug is fixed and a new gem is available at gemcutter, version 0.1.1.
Please install the new gem and give it a try. Also let us know if you find another bug.
Thanks.
shanesveller
Wed Oct 21 11:45:00 -0700 2009
| link
Hello Carlos,
Thanks for the quick response. The updated gem and instructions seem to have down the trick. I'll let you know if I come across any other odd behavior.Thanks again,
Shane
carlosantoniodasilva
Wed Oct 21 12:03:40 -0700 2009
| link
Hey Shane,
Good to know it's everything fine now. I'll close this issue okay.
You're welcome.
Carlos





I'm an idiot.
define that host in the cucumber.rb environment. Or better yet (as suggested by dreamr, put it in your spec_helper and include in cuke, just put you overrides in prod)
Try checking what is inside ActionMailer::Base.default_url_options, it seems it's not being set. And please, if it's not a devise issue, use the mailing list instead:
http://groups.google.com/group/plataformatec-devise
Thanks :)
Oh, you got it. Nice ;)