similar to: newbie: Login/Logout in view

Displaying 20 results from an estimated 10000 matches similar to: "newbie: Login/Logout in view"

2006 Jul 13
8
Acts As Authenticated - smarter login box
Hi, I''ve got AAA loaded and working. I now want to put a smarter login form on the sidebar of my site. If the user is not logged in, I''d like to display a typical form in the sidebar that collects the user ID/password and allows the user to login. If the user is logged in, the box should display something like ''Logged in user: FirstName Lastname'' and a
2007 Jul 06
3
stubbing helper methods for View specs
Hi there I have several view specs, that include the following snippet in their "before" block to stub the methods by acts_as_authenticated before :each do @u = mock_model(User) @u.should_receive(:name).and_return("Hans Muster") template.should_receive(:logged_in?).and_return(true) template.should_receive(:current_user).and_return(@u) end this
2006 Jan 16
16
acts_as_authenticated current_user in a model?
What do I need to do to be able to use an acts_as_authenticated current_user in a model? Is there some sort of include or require I can do some where that would allow this? ********************************************************** Here is what I am trying to do: ********************************************************** class Setting < ActiveRecord::Base before_create :created_by_user #
2006 Apr 21
1
Data access problem in object when using acts_as_authenticated
Hi all, I''m running into this frustrating issue with the acts_as_authenticated plugin and one of the additional fields I added to the users table. I have added a column ''account_type'' to the users table (among several others) which denotes the type of account it is. This stores an integer value that is set by the system during account creation. The value is getting set
2006 Apr 15
9
newbie q: acts as authenticated or login engine?
I''m trying to create a basic web page where people can register. Before they are approved they are emailed a link where that they must click in order to verify their info is correct (or at least their email). Should I use acts as authenticated or the login engine for this? http://technoweenie.stikipad.com/plugins/show/Acts+as+Authenticated http://rails-engines.org/login_engine TIA
2010 Oct 21
4
Authlogic + Rails3 - undefined method `Login' for nil:NilClass
Im new to Rails, and decided to start of with Rails3. After a lot of searching ive managed to get a little bit of Authlogic working. I''m able to register a user, login & logout. Now, I would like to add more features, get more of authlogic working. I''m using Railscast EP 160 as my reference. Portions of the code found on the tutorial throw errors: Eg: <!--
2007 Dec 08
3
ROR 2.0 & undefined method `table_name'
Hi all, I''ve got stuck with this. Here''s the error message: NoMethodError in Account#index Showing account/index.rhtml where line #4 raised: undefined method `table_name'' for Upload:Class Extracted source (around line #4): 1: <h1>My account</h1> 2: 3: Login name: <%= current_user.login %> <br /> 4: Files uploaded: <%=
2010 Nov 07
1
Strange authlogic logout behavior
I am using authlogic for my application''s authentication. If I decide to login with an account and then immediately logout, I get an error. Unknown action The action ''show'' could not be found for UserSessionsController The server log in development says: Started GET "/user_session" for 127.0.0.1 at Sun Nov 07 13:28:31 -0800 2010
2007 Jul 11
3
Problem with Acts as Authenticated not able to logout
Hi all, i installed Act_as_Authenticated plugin yesterday, everything seems fine: trying out the index, divert me to the login screen, i register and login. but when i try http://localhost:3000/account/logout, it didn''t work, after the action been executed, it takes me back to the index as i m logged in. i try to clean the localhost cookie from my firefox, and delete those files in the
2012 Aug 07
9
How do I force link_to/form helpers to use the superclass name in the path instead subclass?
I want my helpers to generate paths using a superclass instead of the subclasses. Assuming I have Owner and Member that both inherit from User, rails will use the current objects class name when generating paths: Let''s say current_user is a mod: <%= link_to current_user.name, current_user %> will generate "/mod/:id". I want to force it to generate
2006 May 10
2
newbie q on displaying a db field value in the view
My layout calls a few links like so: <%= link_to ''| Home '', :controller => ''search'', :action => ''''%> <%= link_to ''| Search '', :controller => ''search'', :action => ''''%> I would also like to display two values from my user table in the same layout right after the
2010 Sep 03
1
Action Controller Error: undefined local variable or method `current_user'
Newbie learning Rails. I''m currently on Chp9 here: http://railstutorial.org/chapters/sign-in-sign-out#top At the end of the tutorial, rails is erroring (see below). being new to Rails and after having checked the tutorial... How do you resolve this kind of error. It''s saying current_user is not defined, and it is supposed to be defined with/Sites/sample_app/app/helpers/
2010 Apr 20
5
Spring Cleaning
Right now in my view, I have a whole HUGE clump of <% if current_user %> and then <% if current_admin %> and then <% if current_teacher %> and then all that other stuff in my view. I have a ginourmous chunk of if and else statements in my views... is there a way to make it prettier? The if and else''s almost all have the same functions, expect for some minor changes.
2006 Apr 13
8
Controller paths
Hi there. Suppose I create some controllers like ruby script/generate controller Admin::product add remove ruby script/generate controller Admin::user add remove ruby script/generate controller Login login logout the directory structure will be app/controllers/admin/product_controller.rb app/controllers/admin/user_controller.rb app/controllers/login_controller.rb Now suppose I need some links
2006 Mar 06
20
How painful is the 1.0 -> 1.1 upgrade going to be?
Does anyone have a sense for how painful the 1.0 -> 1.1 upgrade is going to be for existing apps? I''m finishing up my first real RoR application with Rails 1.0. I can live with it staying at that level, but I really want to use the has_many :through attribute to clean up some of my code. I''m not particularly interested in edge Rails, mainly because the documentation for
2006 Apr 17
2
newbie before_filter question
I''ve successfully gotten acts_as_authenticated working. Currently the before_filter line for my admin screen is like this: class AdminController < ApplicationController include AuthenticatedSystem before_filter :login_required Only issue I have now is that anyone logged in can access that screen. I''d like to differentiate between a regular user and
2006 Feb 11
7
Menu Helper
Hi all, I''m trying to add a common menu to all pages in my application. It is just a set of links I want to display. I''m having trouble deciding where to put the code. Below is what I''ve tried to get out of the "Four Days on Rails" tutorial but no luck. Any help would be appreciated. Am I on the right track? Thanks, Sam
2010 Nov 20
6
syntax error, unexpected tSTRING_BEG
Rails is throwing this error C:/Ruby/Depot/app/views/products/index.html.erb:28: syntax error, unexpected tSTRING_BEG, expecting keyword_do or ''{'' or ''('' ...er.privilege == 50 ? {link_to ''Show'', product} : ''a'' );@out... in line <%= current_user.privilege == 50 ? {link_to ''Show'', product} :
2006 Jan 09
3
Scaffolding - disabling Create, Edit, Destroy for some user logins?
People, I am using: before_filter :login_required in my Controllers and this works fine. For some tables I am happy to use the output of eg: ruby script/generate scaffold Author but is there some way that I can disable Create, Edit, Destroy for some user logins in the corresponding view? Thanks, Phil. -- Philip Rhoades Pricom Pty Limited (ACN 003 252 275 ABN 91 003 252 275) GPO Box
2006 Jun 15
5
[Fwd: Functional test problem]
Anyone? -------- Original Message -------- Subject: Functional test problem Date: Wed, 14 Jun 2006 19:49:03 +0100 From: Chris T <ctmailinglists@gmail.com> Reply-To: ctmailinglists@gmail.com To: rails@lists.rubyonrails.org Embarrassingly late (apps already well advanced), have decided top get to grips with testing and am having a week hopefully covering everything I''ve