search for: sessionscontrol

Displaying 20 results from an estimated 34 matches for "sessionscontrol".

2008 Sep 30
0
undefined method `authenticate_with_http_basic' for #<SessionsController:0xb6c47c44>
...ommands as specified in the tutorial.. my rails version is 1.2.3 and the ruby 1.8.6 I created the restful authentication and i specified the authentication.. ruby script\generate authenticated user sessions ...output omitted... I specified everything.. It worked fine upto 500 pages.. later, class SessionsController < ApplicationController # Be sure to include AuthenticationSystem in Application Controller instead # include AuthenticatedSystem skip_before_filter :login_required He told me to comment the authenticated system and use skip_before.. i done it and the " include AuthenticatedSyste...
2010 Nov 24
1
NameError in Devise/sessionsController#new
...n it, it works fine. Then added cancan gem into it. Created an ability class. define some permissions. Then added line load_and_authorize_resource to the Application Controller, after that when i go to the page http://0.0.0.0:3000/users/sign_in it gave the following error, NameError in Devise/sessionsController#new uninitialized constant Session Rails.root: /home/nazar/rails_projects/sample_can Please help me, i can not solve this issue. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrai...
2009 Oct 18
4
NoMethodError in User sessionsController#new
...uthentication with Authlogic and I get this error. I''ve done some searching but with no success. I tried setting the current_user method in Application_controller to protected and not private, on the recommendation in Stack Overflow. Error in browser----------------- NoMethodError in User sessionsController#new undefined method `require_no_user'' for #<UserSessionsController: 0x24fc700> Error in terminal------------------ Processing UserSessionsController#new (for 127.0.0.1 at 2009-10-17 23:26:38) [GET] Parameters: {"action"=>"new", "controller"=&...
2010 Sep 09
1
NoMethodError in User sessionsController#create
...ng a frustrating go at authenticating a user, pretty sure it must have something to do with gem version conflicts, but I can''t seem to find a solution that works. No matter what username & password that is entered into the login form I get the same error screen: NoMethodError in User sessionsController#create undefined method `protected_password'' for #<UserSession: {:login=>"rtgh", :password=>"<protected>"}> Trace: .../vendor/plugins/authlogic_ldap/lib/authlogic_ldap/session.rb:251:in `send'' .../vendor/plugins/authlogic_ldap/lib/authlogi...
2009 Aug 02
13
NoMethodError in User sessionsController#create - Authlogic
...d http://railscasts.com/episodes/160-authlogic and step-by-step done everything. And almost everything works fine, except login in. After registration new user is automatically logged in, he can edit his profile, but after clicking logout and trying to login again I get error NoMethodError in User sessionsController#create undefined method `mb_chars'' for "rzepak":String My user_session_controller.rb: class UserSessionsController < ApplicationController def new @user_session = UserSession.new end def create @user_session = UserSession.new(params[:user_session]) if @user_...
2011 Jul 28
2
rails 3 routing error
Here''s the error: 1) SessionsController GET ''new'' should be successful Failure/Error: get :new ActionController::RoutingError: No route matches {:controller=>"sessions", :action=>"new"} # ./spec/controllers/sessions_controller_spec.rb:8:in `block (3 levels) in <top (...
2007 Oct 18
4
Mocking models provided in Rails plugins
Hey folks, How do I mock a model that is given to me by a Rails plugin? I''m trying to mock Session from the restful_authentication plugin but I get a number of errors telling me RSpec doesn''t recognize Session. NameError in ''SessionsController handling GET /sessions/new should be successful'' uninitialized constant Session An example of my usage: before do @session = mock_model(Session) Session.stub!(:new).and_return(@session) end Thanks! Dan Croak http://thoughtbot.com organic brains. digital solutions....
2008 Apr 15
4
InvalidAuthenticityToken exception when deleting cookies
Hello, I''ve been testing my project with some manual tests. One of them consists of deleting cookies ("clean personal info" in firefox) just before submit the login form. Then, I get an error. The error message is: ActionController::InvalidAuthenticityToken in SessionsController#create I''m on Rails 2.0.2 with restful_authentication plugin. I''m using default cookie session store, too. Any idea? Thanks. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails:...
2011 Jul 30
22
Question about Helpers
Studying the RoR 3 Tutorial book by Michael Hartl and on page 345 there''s the code inside the SessionsHelper: _________________________________________________________ module SessionsHelper def sign_in(user) cookies.permanent.signed[:remember_token] = [user.id, user.sault] self.current_user = user end end __________________________________________________________ What is the purpose
2010 Nov 14
5
Authlogic and rails 3 : NameError in User sessionsController#new
...railscasts.com/episodes/160-authlogic), and the resources I was able to find on the web, but I''m facing a problem. Once I''ve generated the user_sessions controller and mapped the login and logout routes, I get an error if I try to load the login page : uninitialized constant UserSessionsController::UserSession app/controllers/user_sessions_controller.rb:11:in `new'' The user_sessions model is really simple : class UserSession < Authlogic::Session::Base end But it looks like this class declaration is not considered by Rails... Does anyone have an idea ? Thx by advance for yo...
2012 Feb 03
10
ruby on rails 3 tutorial book chapter9 Signin Failure
...; @title = "Sign in" render ''new'' else # Sign the user in and redirect to the user''s show page. end end If I check in my browser and clic on submit with all fields empty, I get the following error: NoMethodError in SessionsController #create undefined method `nil'' for nil:NilClass I check the book many times and I have code exactly as the book, but I still have the error. Any help??? You can check the code in this link listing 9.8 http://ruby.railstutorial.org/chapters/sign-in-sign-out#sec:signin_failure What I d...
2013 Aug 26
2
linkedin login using omniauth
...e.tap do |user| user.provider = auth.provider user.uid = auth.uid user.name = auth.info.name user.oauth_token = auth.credentials.token user.oauth_expires_at = Time.at(auth.credentials.expires_at) user.save! end end /controller/sessions_controller.rb class SessionsController < ApplicationController def create user = User.from_omniauth(env["omniauth.auth"]) session[:user_id] = user.id redirect_to root_url end def destroy session[:user_id] = nil redirect_to root_url, :notice => "Signed out!" end end /config/initialize...
2007 Dec 30
6
Restful-Authentication Rspec Failure Rails 2.0.2
I am trying the Restful-Authentication (latest version, downloaded today) and upon running the generator, doing the migration, prepping the test system and putting the resources in routes.rb I get a Rspec test failure: ''SessionsController logins and redirects'' FAILED expected not nil, got nil routes.rb has: map.resources :users map.resources :sessions nothing else was changed or done. there is only one other controller/ model in the system and rspec tested it with no errors. Is this a known bug? Should I just be us...
2008 Aug 30
3
Working with sessions in beast forum
...would allow them to change their location for a session whilst not changing the value in their settings. I know that I have to set this value when a session is created but I''m baffled about how (and where exactly) I have to do it. The following code is used when creating a session: class SessionsController < ApplicationController def create if using_open_id? cookies[:use_open_id] = {:value => ''1'', :expires => 1.year.from_now.utc} open_id_authentication else cookies[:use_open_id] = {:value => ''0'', :expires => 1.year.ago....
2009 Jul 13
6
first app on Dreamhost with Passenger : "rails needs to know your username and password" ?
I am trying to deploy my first rails app with Dreamhost. I ftp''d over my existing app, turned on Passenger and pointed it to my /public directory. When I go to ''www.mydomain.com'' I get the ''Ruby on Rails: Welcome aboard'' default page, including the following: Getting started Here’s how to get rolling: 1. Create your databases and edit
2012 Sep 05
0
Generate devise session controller
...to rails. I used devise in my project ,i need to write some conditions in my session controller.How can i generate devise session controller. I have user.rb model. Steps which i made: 1. Generate rails g controller session 2. Session controller generated 3. Changes the text like, class Users::SessionsController < Devise::SessionsController end 4.In routes i have changed, devise_for :users, :controllers => { :sessions => "users/sessions" } While execute i got an error: Routing Error uninitialized constant Users Try running rake routes for more information on available routes....
2014 May 13
0
super is not working on after_sign_in_path_for(resource)
I have this: class Users::SessionsController < Devise::SessionsController def after_sign_in_path_for(resource) super end super redirect to root_path and i dont want to do it. I need to redirect other view -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubs...
2008 Sep 12
1
restful_authentication rspec failures "Mysql::Error: Incorrect datetime value:"
...d blog title:string content:text rake db:migrate rake spec # 37 examples, 0 failures git add . git commit -a -m "blog with passing rspec tests" ruby ./script/generate authenticated User Sessions rake db:migrate # 288 examples, 193 failures 1) ActiveRecord::StatementInvalid in ''SessionsController on signout redirects me to the home page'' Mysql::Error: Incorrect datetime value: ''2008-09-13 21:22:52 UTC'' for column ''remember_token_expires_at'' at row 1: INSERT INTO `users` (`salt`, `updated_at`, `crypted_password`, `remember_token_expires_at`, `i...
2012 May 12
12
before_save messing up
...ion has_secure_password before_save :create_remember_token . . . . . . . private def create_remember_token self.remember_token = SecureRandom.urlsafe_base64 end end #sessions_controller.rb -------> Sessions Controller class SessionsController < ApplicationController def new end def create user = User.find_by_email(params[:session][:email]) if user && user.authenticate(params[:session][:password]) sign_in user redirect_to user else flash.now[''error''] = ''Invali...
2007 Dec 23
3
InvalidAuthenticityToken problems with my login form
...''6de86b5566d7598f57e757960760acd2'' } in my application.rb protect_from_forgery :secret => ''6de86b5566d7598f57e757960760acd2'' my sessions_controller.rb doesn''t have anything new inside... same code as used with rails 1.2 (is it right ?) class SessionsController < ApplicationController def new @login = "" end def create if open_id?(params[:login]) open_id_authentication params[:login] else password_authentication params[:login], params[:password] end end what should I take care in this conversion ? tha...