Displaying 20 results from an estimated 4000 matches similar to: "Change password"
2006 Mar 29
5
How to skip password validation when updating other fields?
Besides the hashed password, which is saved to db, I have two
password-attributes in my User model:
attr_accessor :password, :password_confirmation
I have validations on these attributes, and I need them to work both on
create and update, since I have pages for changing and resetting the
password.
Now when I want to update just the user''s login name, I guess I have the
next
2006 Feb 27
4
update_attribute with Validation?
Does anyone know of a way to update individual attributes with
validation? update_attribute disables the validation checks in the
record model, so I''m wondering if there''s a workaround for this.
In my application, I want to allow the user to update some or all the
attributes without having to enter :password and :password_confirmation,
both of which are subject to
2006 Jul 17
19
updating model
hello,
i am writing a simple user login system.
when registering a user account, i have two field:
password
password_confirmation
which are validated using
validates_presence_of
validates_confirmation_of
and these are then used to generate a password hash which is stored in
my database
when i want to update the record (without changing the password and
entering new values for password and
2012 Sep 17
1
require current_password to update user information
Rails newbie here, I have been stuck on this for two days and can''t figure
out why its not working.
I want users to confirm/verify themselves by entering their current/old
password before any information is updated.
This is what My user_controller update action looks like
I''m currently using rails 3.2 with the basic has_secured_password
authentication that comes with it.
def
2006 Jan 13
2
Change Password with acts_as_authenticated
I want to have a form to change a users password. I can''t figure out
what the method in the controller should look like. I tried @user.save
and @user.update_attributes, but can''t get it to work.
My Form:
##############################
<%= start_form_tag :action => "update_password", :id => @user.id %>
<%= password_field ("user",
2005 Apr 23
7
Validation question
Hi all,
Is there a way to invoke validations at times other than save, create
and update? I know that I can do this by writing my own validation
checks using errors.add_[blah], but I''d like to leverage the existing
validation code.
What I have is two sets of fields in a record, set A and set B. Both
sets must be validated on record create. However, the trouble is that
after
2009 Dec 23
8
Where did this value in a form come from?
Newb here.
I have a form and a value that is being displayed ... and I have no idea
where the value came from.
I have done a
<%= debugger; '''' %>
in the form and, indeed, the debugger stops at the statement.
I have tried to trace through the code to see where the value came from
... and I gave up.
So ... what in Rails initializes the fields of a form?
--
Posted via
2005 Oct 14
7
validates_confirmation_of not working
Hello, I''m having a weird problem in my user model. For the
change_password method I have the following:
def change_password(oldpass, newpass, confirmation)
oldpass = self.class.myhash(oldpass)
reload
passhash = self.password
self.password = newpass
self.password_confirmation = confirmation
if valid? and oldpass == passhash
save!
else
# valid?
2008 Feb 14
4
How do I access this parameter?
Hi,
I have a form for creating users ...
<% form_tag ''userconfirm'' do -%>
<!-- more code -->
<p><label for="user_login">Username</label><br/>
<%= text_field ''user'', ''login'' %></p>
<p><label for="user_password">Password</label><br/>
<%=
2011 Jul 27
2
rails 3.0.9 usability problem
If there is an error with the submitted password on a form, then both
the password and password confirmation text fields should be highlighted
in red. The default seems to be to highlight only the password field.
Any suggestions on how to correct that? Because rails magically handles
the highlighting, I''m not sure how to intercept that.
--
Posted via http://www.ruby-forum.com/.
--
2006 Jan 20
8
validates_confirmation_of not working
is there any special requirement for validates_confirmation_of ? I am
trying to make sure 2 passwords are equal (cleanly the rails way)..
In my view i have two fields with id user[password] and
user[password_confirmation].
in the model i have
validates_confirmation_of :password, :message =>"Passwords do not match "
Am i missing something here ?
thanks
adam
2007 Apr 16
6
How to use a form.check_box ?
Hey guys,
I''m trying to have a simple webform in my administration section to
add a user. I have the text_fields for adding the user''s name,
password, and password confirmation, but cannot seem to figure out the
checkbox. I want it to be a single checkbox, that if clicked, will set
the database column "access" to be "admin" and if its unchecked, set
it to be
2006 May 02
9
Updating only one field
At present, I use an update like this to set the user''s last login time:
authenticated_user.update_attribute(:last_login, Time.now)
However, this calls the following, updating all fields:
UPDATE users SET `last_login` = ''2006-05-02 13:27:41'', `hashed_password`
= ....
Is there any way I can tell ActionRecord to only update the one field?
I don''t really want
2010 Aug 18
2
auth logic - password confirmation
Hi, newbie here. :)
i have this form on a test rails app:
<% form_for @user do |f| %>
<%= f.error_messages %>
<p>
<%= f.label :username %><br />
<%= f.text_field :username %>
</p>
<p>
<%= f.label :email %><br />
<%= f.text_field :email %>
</p>
<p>
<%= f.label :password %><br
2006 Jul 04
1
LoginGenerator Problem
I am trying to make a barebones login system based on this example
(which in turn is just standard RoR login) but when I enter a user name
and password, it says the login is unsuccessful every time. I am not
sure where I am going wrong. Here is all relevent information
CREATE TABLE `users` (
`id` int(6) unsigned NOT NULL auto_increment,
`login` varchar(20) NOT NULL default
2006 Oct 06
3
params 101
This is incredibly basic, but...
I have a form that has fields defined for password and
password_confirmation. it is passing in the following data
Parameters: {"commit"=>"Change Password",
"admin"=>{"password_confirmation"=>"beagle", "password"=>"beagle"},
"id"=>"3"
I thought that
2008 Jan 16
4
ActionController::InvalidAuthenticityToken in LoginController
Hi,
I''m having a problem trying to get a login controller working. When I
try and post to my login controller I get the following error:
ActionController::InvalidAuthenticityToken in LoginController#login
login_controller:
class LoginController < ApplicationController
def login
case request.method
when :post
if @session[''user''] =
2006 Apr 04
2
how to perform client side validations in RoR?
Hi,
I have a form for user registration. In that form there are fields for
password & confirm_password. Now in my database there is column
corresponding to password field. Now at clicnt side I want to validate
equality of password & confirm_password field. How to do that?
I have downloaded one password validator plugin & tried to used it. But
it requirs two seperate fields in
2007 Dec 04
10
Unexpected message on :attr_accessor
This may be a dumb noob issue, but I haven''t found any answers while seaching
the forum--
I have a controller method
def edit
@user = User.find params[:id]
@user.password_confirmation = @user.password
end
The User class has an "attr_accessor :password_confirmation" definition (so
"password_confirmation" doesn''t exist in the users table). My spec
2007 Dec 31
1
Agile Web Dev w/Rails - Password Change
Happy New Year everyone.
Just wondering if anyone has coded the ability to allow a user to change
their password following the way the book (second edition) implements
administration.
Seems like I should be able to cut out the
password/password_confirmation portion of ''add_user'' form to create a
''change_pass'' form. The problem is I''m not sure how to go