This link has been bookmarked by 187 people . It was first bookmarked on 06 Jun 2006, by Alex Ilyin.
-
04 Jan 13
-
11 Nov 12
-
self.salt = User.random_string(10) if !self.salt?
-
-
26 Sep 12
-
30 Sep 11
-
17 Aug 11
-
03 May 11
-
07 Mar 11
-
19 Jan 11
-
29 Dec 10
-
01 Dec 10
-
13 Oct 10
-
19 Sep 10
-
14 Jul 10
David CharlesExample of a authentication mechanisms in rails. Not sure I need this now as we're using weborb for dmcp
-
01 Jun 10
-
10 Apr 10
-
08 Apr 10
-
06 Mar 10
-
21 Jan 10
-
16 Dec 09
-
01 Nov 09
-
29 Aug 09
hamed ramezanianBasic User Authentication in Rails
rails rubyonrails ruby tutorial programming security howto development authentication
-
hamed_rBasic User Authentication in Rails
rails rubyonrails ruby tutorial programming security howto development authentication
-
20 Aug 09
-
02 Aug 09
-
16 Jul 09
-
23 Jun 09
-
26 May 09
-
22 Mar 09
-
18 Mar 09
-
13 Jan 09
-
11 Jan 09
-
10 Nov 08
-
08 Sep 08
-
03 Sep 08
-
25 Jun 08
-
15 Apr 08
-
23 Mar 08
-
21 Mar 08
-
01 Mar 08
Marcelo Pinheirouser authentication routine for ruby on rails development
development rails Ruby rubyonrails software tips tutorial webdevelopment webdev webdesign authentication programming security
-
28 Jan 08
-
27 Jan 08
-
20 Dec 07
-
18 Dec 07
-
19 Nov 07
David WarringtonThis article walks through creating a basic authentication system in rails.
rails ruby authentication howto tutorial programming security session examples tips
-
15 Oct 07
elle mThis article walks through creating a basic authentication system in rails.
-
03 Oct 07
Kenneth PriisholmThis article walks through creating a basic authentication system in rails.
-
08 Sep 07
-
22 Aug 07
-
j dThis is a great tutorial on rolling your own user authentication system in Rails. It includes explanations about security issues, tests, generators, etc. Very well done and a nice reference.
rails ruby RubyOnRails authentication login security tutorial delicious
-
16 Aug 07
-
15 Aug 07
Chris PrattGreat newbie tutorial on user management. Actually includes tests as well, which most Rails tutorials always gloss over.
authentication rails rubyonrails ruby tutorial security login programming
-
09 Jul 07
-
16 Jun 07
-
22 May 07
-
08 May 07
-
16 Mar 07
Philippe Hoout several different plugins and generators for user authentication. Each time I ended up spending more time installing, figuring out and adapting the code than I would have spent if I wrote it from scratch. Each project I’ve worked on has had differen
-
12 Mar 07
-
09 Mar 07
-
03 Mar 07
Nicolas PerriaultThis article walks through creating a basic authentication system in rails.
rails ruby programming security authentication identity identification tutorial
-
This article walks through creating a basic authentication system in rails.
rails ruby programming security authentication identity identification tutorial
-
22 Feb 07
-
10 Feb 07
-
07 Feb 07
-
05 Feb 07
-
12 Jan 07
-
04 Jan 07
-
The functions in the
Submitted by Anonymous on Tue, 2006-09-19 13:56.The functions in the application.rb file are very useful, but how does one use them in the views?
For example, if I want to show a link to a user only if logged in, this doesn't work:
<% if current_user -%>
<a href="http://www.aidanf.net/admin">Admin Functions</a>
<% end -%>
because current_user is not available to the view.» replyJust add:helper_method
Submitted by Adam B. on Sat, 2006-10-14 23:09.Just add:
helper_method :current_userafter the ApplicationController#current_user definition:def current_user
session[:user]
end
helper_method :current_userI did this to create a logged_in? method (as in acts_as_authenticated) that is available to the views and the controllers:
def logged_in?
return session[:user] ? true : false
end
helper_method :logged_in? -
Alternatively you could require users to validate using email. This would mean adding a field to the database with a validation key. Put a random unique hash in this field when the user is created. Don’t allow a user to login unless this field is null. Add a controller method and view to validate users using this hash key and email them a link to this with their own key as a parameter when they signup.
-
We start out by defining validations for the user model.
passwordandloginmust be within pre-defined length.loginandemailmust be unique.emailmust match a certain format.validates_confirmation_ofensures thatpasswordmust be confirmed usingpassword_confirmation.login,email,password,password_confirmationandsaltmust all be present. When creating a new user or saving an existing one, all these conditions must be met or the save will fail. -
def edit @item=Blog.find(:first, :conditions=>["user_id=? and id=?", current_user.id, params[:id]]) ... end
-
-
23 Dec 06
Attila GyörffyThis article walks through creating a basic authentication system in rails.
-
16 Dec 06
-
15 Dec 06
-
14 Dec 06
-
27 Nov 06
-
07 Nov 06
-
02 Nov 06
-
26 Oct 06
-
25 Oct 06
-
26 Sep 06
-
11 Sep 06
-
29 Aug 06
-
24 Aug 06
-
08 Aug 06
-
04 Aug 06
-
03 Aug 06
-
27 Jul 06
-
25 Jul 06
-
20 Jul 06
-
The rails way seems to be to put as much logic as possible into the models. To think of it another way, you should be able to run your application through all its important processes by calling methods on model objects at the console. More concretely core logic such as authentication and sending a new password should be in the model, not the controller.
-
-
09 Jul 06
-
02 Jul 06
-
26 Jun 06
-
20 Jun 06
David FontanellaThis article walks through creating a basic authentication system in rails.
-
16 Jun 06
-
15 Jun 06
-
13 Jun 06
-
08 Jun 06
-
07 Jun 06
-
06 Jun 06
Would you like to comment?
Join Diigo for a free account, or sign in if you are already a member.