Displaying 20 results from an estimated 1300 matches similar to: "ActiveRecord Associations not working in RSpec with Devise"
2013 Mar 07
0
custom table_name for table users with devise
Hi
for my app, I have several tables for users (franceusers, belgiumusers, 
...) and I would like to use one or another depending on domain
I tried with table_name_prefix and table_name but it seems to not work 
class User < ActiveRecord::Base
  rolify
  # Include default devise modules. Others available are:
  # :token_authenticatable, :confirmable,
  # :lockable, :timeoutable and
2011 Jun 11
1
Having a problem adding a foreign key
I keep getting this exception   "SQLite3::SQLException: no such
column: books.user_id: SELECT "books".* FROM "books" WHERE
("books".user_id = 4)" ,which sounds like there is no user_id in books
table.So i just installed foreigner plugin and added "
t.integer :user_id, :null => false" and
"add_foreign_key(:books, :users)" in book
2011 Jun 13
0
Devise Authorization Error
Hello everyone,
I am new to rails and I am having some trouble getting the Devise
authorization plugin working. I can get the login page to display, but
when I enter the credentials for a known user (I seeded an account to
the database) it just says "Invalid email or password," even though
I''m 100% sure I entered the right information, and redirects me to the
login form.
2011 Aug 10
3
STI Devise, remove sign up for admin
Hi,
If I''m using STI with Devise, I have a Admin model inheriting the base
Devise User model. I would like to remove ''registerable'' from the
Admin model but it inherits registerable from the user model. How
would i disable registration for admins?
-- 
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To
2010 Aug 08
0
registerable method undefined in Devise migration (was Re: Re: No route matches)
On 8 August 2010 23:39, Abder-Rahman Ali <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:
> I tried to make the application from scratch again, and
> notices that I get the following when I run: $ rake db:migrate
>
> (in /Users/abder/Desktop/Rails/auth)
> ==  DeviseCreateUsers: migrating
> ==============================================
> -- create_table(:users)
2011 Jul 14
10
Devise confusing routes
I had a similar problem yesterday.
I would go to the root of my site and I would get a Too Many Redirects
message. It seems like there was an infinite loop. After struggling for
over an hour yesterday late at night, it seemed like I fixed it.
But now, when I want to create a New User, it''s redirecting me to the
Sign In screen. Seems like I didn''t fix the problem completely.
I
2011 Nov 05
13
Adding a site admin user while creating a site
Hi Gurus,
I wanted to add siteadmin user(basically a user with a certain role)  while
creating the site itself.  I hope that i have done all the necessary stuff
by going through raynb''s railscasts (
http://railscasts.com/episodes/196-nested-model-form-part-1)  But could not
see user fields being displayed in the site creation form.. Below are the
details.
I Have two model users and
2013 Jun 25
6
creating an account with a username in devise
Hello, all.  I have followed these links and have enabled a (current)
user to login with a username:
http://railscasts.com/episodes/209-introducing-devise
http://railscasts.com/episodes/210-customizing-devise
https://github.com/plataformatec/devise/wiki/How-To:-Allow-users-to-sign-in-using-their-username-or-email-address
I want to allow a user to sign up with a username but am getting these
2006 Jul 25
0
Some specs
Hi,
I''d really appreciate someone looking at some specifications I have.
The context in each case is realised in the setup block (I''m assuming
this is standard practice?).  The specifications should be
self-explanatory.
I''m wondering if anyone can see anything obviously bad/wrong with what
I have?  I''m intentionally not stating anything else as in theory the
2010 Sep 17
0
ruby's oauth2 grant_type
Hi, i started using oauth2 gem by intridea
(http://github.com/intridea/oauth2) and don''t know how to fix this
problem. I have developed both client and server and on request for
access_token i see no grant_type parameter. My code from client callback
controller
class CallbackController < Devise::OauthCallbacksController
  def accounts
    access_token =
2009 Jan 23
1
Validation levels
Sometimes I want to show just one error, even when a field fails two or
three validations.
A custom validation method is easy enough, but the helpers are nice and
concise.
So, has anyone found a way of doing this with AR''s validation helpers?
The :if/:unless look promising, but its made harder by validations being
applied in a random order.
- Andy
P.s. The validatable gem has the
2013 Jun 06
1
Introducing MailJack: autogenerate querystring parameters that are appended to links in your emails
Hey All,
I just wrote a nifty gem and wanted to share(its one of my first). 
Wondering if anyone would be so kind as to tell me what they think and/or 
code review it. 
MailJack - its like LoJack but for the links in your emails.  The problem 
this solves is the ability to track click throughs in emails.  
https://github.com/synth/mail_jack
Basically, you specify what mailers you want to track
2011 Feb 14
0
Devise is causing the [The change you wanted was rejected.] Error...
I am using the custom made Devise controller.
I moved from PHP to Rails that, old users password are stored in
Devise:user table in form of
"devise_encryption(oldencryption(password))"
If an user login, and app finds out that this user''s password is in
form of "devise_encryption(oldencryption(password))", I then change it
in to a form of
2011 Feb 06
2
Controller Testing + Devise = boom (undefined @controller, request)
Here I am, trying to learn TDD and BDD.  Getting start, most simple
case, and the world is falling apart:
My test code:
  it "should respond with success" do
      puts ''hi''
#      get :new
#      response.should be_success
    end
My stack trace:
$ rspec spec
"controller: nil"
F
Failures:
  1) VideosController new exposes request and response before and
2011 Aug 25
1
Devise + Forem: undefined method weeks on Fixnum
I''m getting the following message when trying to start Webrick or
console.
... devise-1.0.11/lib/devise.rb:89:in ''<module:Devise>'': undefined
method ''weeks'' for 2:Fixnum (NoMethodError)
After trying to upgrade my app to Rails 3.1 (edge) so that I may use the
Forem engine.
I''m under the impression this error is occurring because
2011 Nov 21
0
How to use two different sets of mailer templates for two different Devise models?
I''m using Resque to send Devise emails. To do so I set:
devise.rb
config.mailer = "Mailers::Devise::DeviseMailer"
But I have 2 devise models -- User and Client. I want to send
different devise mailer templates for each.
devise.rb says "The first four configuration values can also be set
straight in your models.", and config.mailer is one of those first
four, but
2012 Feb 28
0
Devise with two emails
Hi, I''m trying to setup a User model with devise, and I want it to have two
emails (personal and work, for example).
And I want them to work as the normal email from devise, except that the
login will be done with a username attribute. But the emails that devise
will send, I expect to be delivered to both emails.
I also want all the normal email validations on both emails (done by
2012 Aug 18
0
Migrating users from devise to bcrpyt-ruby
Hi guys,
How would one migrate users on a rails site using the devise gem for 
authentication to using the bcrpyt-ruby gem(has_secure_password rails 
option) for the same? I know that both use bcrpyt, but devise has the 
stretches and pepper configurations in the devise.rb file and I''m a little 
uninformed on how to translate these for the bcrypt-ruby gem. 
Is the pepper configuration
2011 Jun 27
0
Devise Invitable mailer -- how to force text/plain e-mail?
I am using Rails 3.09 and the latest Devise and Devise Invitable. I am  
able to make Devise send confirmation messages as text/plain just by  
adding a view properly named to the views/devise/mailer folder.  
Invitable keeps its views in views/users/invitations/mailer, but  
changing the name of the file (and the contents) does not seem to  
affect this at all. Instead, the view is being loaded
2010 Aug 09
0
Devise :current_password validations and checking (how???)
Hi Guys,
In my devise applications in Rails 3, I created a separate form under my
SettingsController class of which it handles the ''Change Password'' of
the User Model, so i can manipulate the current_user in the
SettingsController.
Now, I followed the set-up in the Devise/Views on how to update the form
using ''Change password''  and either way update User for