search for: set_user

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

Did you mean: get_user
2006 Jun 02
6
Set instance variable for all actions in the Controller
Can I set an application wide instance variable that is available for all actions...and their views? eg. class ApplicationController < ActionController::Base @current_user = User.find(session[:user_id]) end and everywhere I can call @current_user.id and I can get that object? Even down in the views? I could not get this to work... Thanks in advance, Jeff -------------- next part
2007 Sep 13
5
Authenticating before tests
Hi all, I''m using Goldberg, an engine that provides roles based access control for my app. I need to login before I can do controller tests, but I can''t find any examples of people doing this. Could someone point me in the right direction? I thought the simplest way would be to either call the login action from my other tests before(:all), but I can''t seem to
2006 Apr 11
0
a user model in all controllers in 6 lines of code
Well it took a bit of research, and making a fool out of myself; but I found a way to get a user model from the session and have it accessible in every controller and view in 6 lines of code. In the ApplicationController write model :user before_filter :set_user private def set_user @user = session[:user] ||= User.find_by_username(''nobody'') end I have redeemed myself (whoohoo!!)
2007 Jul 17
12
Getting past my login system
Thank you in advance for your help. I am relatively new to both Rails and Rspec and I am hoping for some insight from some experienced veterans. Right now I am using Rspec for code that has already been written so that additional functionality can be developed using the BDD method. My problem shows up when I try to spec controllers that are behind the login system. Each page checks for the
2006 Jun 04
5
filter function with parameter
Hi! I want to add a function with a static paramter ("2" in the example) to a filter, but somehow Rails seems to be looking for another syntax. before_filter :check_quantity(2), :only => [:show] doesn''t work. What''s the right way to do this? Thanks a lot! -- Posted via http://www.ruby-forum.com/.
2014 Sep 04
10
[PATCH 0/5] use augeas for /etc/shadow
Hi, currently /etc/shadow is edited manually when needed (i.e. when setting the password for an user), and it is not changed when removing users. Import the upstream shadow.aug (currently in their development serie, but not part of any released version yet), and use it only when the augeas version is less than a potential 1.2.1 (covering also the case when the new version is just 1.3.0). Pino
2007 Mar 28
2
[PATCH 2/3] User-space grant table device - main driver
A character device for accessing (in user-space) pages that have been granted by other domains. Signed-off-by: Derek Murray <Derek.Murray@cl.cam.ac.uk> _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel