search for: session_controller

Displaying 7 results from an estimated 7 matches for "session_controller".

2006 Jan 08
6
newbie session confusions
...t''s declared so @user shouldn''t be lost between method calls within a single controller but it is. @user seems to be acting like a local variable, user. It doesn''t seem like I can access the session hash from a model for some reason. Why not? Also, If I generate a session_controller.rb does that have any kind of special status or is it just like any other controller I generate? Is there any reason to run the script/generate controller command other than to save me a minute creating files (controller, helper, view, test, etc.)? thanks, russ
2007 Nov 17
18
Syntax Problem
I admit I am stuck. I am converting a legacy php site to ROR. The old site uses MD5, a security flaw waiting to happen. I upgraded to AAA and am adding code in the session_controller.rb file to see if crypted_password is blank. If it is, crypt and check the password against the old md5 version and write it in the new crypted_password field. Here is my code add on before the logged_in?: def create # if no password use old md5 and fill in with sha2 user = User.find_by_l...
2013 Sep 26
2
Login Problem
...rs" WHERE "users"."id" = 2 LIMIT 1 Redirected to http://localhost:3000/ Filter chain halted as :require_no_authentication rendered or redirected. Inactive users still login, but while debugging, it doesn''t show anything. It goes to the else part, still logs in. session_controller:- prepend_before_filter :require_no_authentication, :only => [ :new, :create ] prepend_before_filter :allow_params_authentication!, :only => :create prepend_before_filter { request.env["devise.skip_timeout"] = true } skip_before_filter :verify_authenticity_token def create...
2007 Oct 16
2
Named routes in controller not working?
I have some "redirect_to"s using named routes in a controller that work fine in the browser, but choke my tests. The route in question is "new_session" and comes from a "map.resource :session, :controller => :session" route mapping. If I replace the named route in the controller with controller/action the tests run just fine, but for some reason it doesn''t
2007 May 26
11
RSpec
...m /Users/multimedia/Desktop/restful_auth_rspec/vendor/plugins/rspec/bin/spec:3 rake aborted! Command ruby -I"/Users/multimedia/Desktop/restful_auth_rspec/vendor/plugins/rspec/lib" "/Users/multimedia/Desktop/restful_auth_rspec/vendor/plugins/rspec/bin/spec" "spec/controllers/session_controller_spec.rb" "spec/controllers/user_assets_controller_spec.rb" "spec/controllers/users_controller_spec.rb" "spec/helpers/user_assets_helper_spec.rb" "spec/helpers/user_assets_url_helpers_spec.rb" "spec/models/asset_spec.rb" "spec/models/authen...
2007 Jul 24
6
Mocking Access Control
I''m trying to jump on the TDD/BDD bandwagon, but am having trouble understanding how i should mock my user. The user has a habtm relationship to a roles model (acl_system2 plugin), but I''m not sure how to tell rspec about a model. My code: describe UsersController do integrate_views before(:each) do @user = mock_model(User)
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