search for: database_authenticat

Displaying 9 results from an estimated 9 matches for "database_authenticat".

2011 Jun 11
1
Having a problem adding a foreign key
...%= f.submit "Add book"%> BOOK MODEL class Book < ActiveRecord::Base belongs_to :user end USER MODEL class User < ActiveRecord::Base has_many :books # Include default devise modules. Others available are: # :token_authenticatable, :lockable, :timeoutable and :activatable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable # Setup accessible (or protected) attributes for your model attr_accessible :email, :password, :password_confirmation,:firstname,:lastname,:school,:major,:sex,:zipcode end ROUTE Campus::Application.routes.d...
2011 Jun 13
0
Devise Authorization Error
..._out => ''logout''} resources :admin end # UsersController devise_for :users, :path_names => {:sign_in => ''login'', :sign_out => ''logout''} --- END routes.rb --- --- admin.rb (Model) --- class Admin < ActiveRecord::Base devise :database_authenticatable, :recoverable, :rememberable, :trackable, :validatable attr_accessible :email, :password, :password_confirmation, :first_name, :last_name, :superadmin end --- END admin.rb --- --- new.html.erb (The login form) --- <div class="login_container"> <div class="title_cont...
2012 Feb 04
0
ActiveRecord Associations not working in RSpec with Devise
Hi everyone, I have the following classes: class User < ActiveRecord::Base devise :database_authenticatable, :registerable, :timeoutable, :recoverable, :rememberable, :trackable, :validatable has_many :comments, :dependent => destroy ... end class Comment < ActiveRecord::Base belongs_to :user belongs_to :commentable, :polymorphic => true ... end In rails console, I can succ...
2013 Mar 07
0
custom table_name for table users with devise
...nother 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 :omniauthable devise :database_authenticatable, :registerable, #:confirmable, :recoverable, :rememberable, :trackable, :validatable def self.table_name debugger ''franceusers'' end def self.table_name_prefix debugger ''france'' end thanks to debugger, I can see that is call...
2010 Sep 17
0
ruby's oauth2 grant_type
...ter_oauth_success_path_for(@user) #=> redirects to user_root_path or root_path else session[:user_accounts_oauth_token] = access_token.token render_for_auth #=> renders sign up view by default end end end and from User model class User < ActiveRecord::Base devise :database_authenticatable, :oauthable def self.find_for_accounts_oauth(access_token, signed_in_resource=nil) data = ActiveSupport::JSON.decode(access_token.get(Settings.oauth.site + Settings.oauth.access_token_path)) if user = User.find_by_username(data["username"]) user else # Cre...
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
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
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
2011 Nov 05
13
Adding a site admin user while creating a site
...------------------------------ class User < ActiveRecord::Base *belongs_to :sites ########### I have added this * # Include default devise modules. Others available are: # :token_authenticatable, :encryptable, :confirmable, :lockable, :timeoutable and :omniauthable devise :database_authenticatable, :registerable, :recoverable, :rememberable, :trackable, :validatable # Setup accessible (or protected) attributes for your model attr_accessible :email, :password, :password_confirmation, :remember_me, :role, :site_id end ------------------------------ *My site model:* --------...