similar to: Replicating Form Behaviour in Functional Test

Displaying 20 results from an estimated 6000 matches similar to: "Replicating Form Behaviour in Functional Test"

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/> <%=
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
2014 Mar 25
0
Looking for some glue between Strong Parameters and CanCan
Hello Rails World, does anybody know a good solution for Strong Parameters in a Rails app authorized by Cancan (or a similar authorization gem)? def user_params if current_user.admin? params.require(:user).permit! else params.require(:user).permit(:password, :password_confirmation) end end Now I want to do this the "Cancan way". My first idea looks strange to me: def
2006 Jan 20
0
Problem with updating model
I trying to update DATE type field in MySQL but such errors occurs errors: password_confirmation: - "can''t be blank" birthday: - "can''t be blank" Spending hours on that, I cann''t find the reason But I''ve filled "login" "password" "password_confirmation" and "birthday" fields
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
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?
2010 Aug 09
0
Devise :current_password validations and checking (how???)
Hi Guys, In my devise applications in Rails 3, I created a separate form under my SettingsController class of which it handles the ''Change Password'' of the User Model, so i can manipulate the current_user in the SettingsController. Now, I followed the set-up in the Devise/Views on how to update the form using ''Change password'' and either way update User for
2010 Nov 19
1
I18n::InvalidLocaleData error on load page
Hi All, I use rails 3.0.1 in my application and when the server web load this following page http://localhost:3000/signup <h1>Sign up</h1> <%= form_for(@user) do |f| %> <div class="field"> <%= f.label :name %><br /> <%= f.text_field :name %> </div> <div class="field"> <%= f.label :email %><br
2011 Apr 16
0
adding HABTM association while creating a record
Hello Experts, I have a HABTM association as followed: class Account < ActiveRecord::Base has_and_belongs_to_many :user end class User < ActiveRecord::Base has_and_belongs_to_many :type has_and_belongs_to_many :account end class Type < ActiveRecord::Base has_and_belongs_to_many :user end I have the following query; I Have a parent user who is creating another user under its
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",
2006 Jan 11
0
error_messages_for >> Cannot convert Array into String
Hi all I have the following Model: Member(id, username, first_name, last_name, hashed_password, password_salt) Now I want to allow users to register for an account using the following form: --- <%= form_tag %> <%= error_messages_for ''member'' %> <p><%= _(''Username'') %>: <%= text_field(''member'',
2013 May 19
5
update_attributes() for a single column
I was just faced with a strange ROLLBACK exception when attempting to execute this code: $ rails console user = User.first User Load (1.1ms) SELECT "users".* FROM "users" ORDER BY "users"."id" ASC LIMIT 1 => #<User id: 1, name: "Michael Hartl", email: "foo-+RB1Aph5k6s@public.gmane.org", created_at: "2013-05-12
2007 Oct 23
11
validates_confirmation_of not working?
I just can''t get validates_confirmation_of working for the life of me!... It''s not the first time I''m having problems with it but I just never understand why!... This time I pretty much followed *exactly* the example in Agile Rails Development and still...it just won''t work! I put 2 different passwords in the form and it doesn''t trigger an error,
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
2010 Jan 26
2
accepts_nested_attributes_for :has_many :through => 'bug?'
Hey guys & ladies! I''ve got the following relationship which i''m trying to get accepts_nested_attributes to work with. But when i submit my form, it looks as if its expecting a Company object, rather than an array of companies. which really doesn''t make sense considering its a has_many :relationship. So what i''m after, is a way to
2005 Sep 02
7
Form to update two tables
Hello there, this is probably a very simple problem but I''m stuck. I''m following the Login generator tutorial from rubyonrails. It''s all worked fine so far. But I want to add a bit more functionality so that when a user signs up in addition to chosing a login name and password they type in a company name which is added to a seperate table called COMPANIES. The id
2011 Jun 13
0
Devise Authorization Error
Hello everyone, I am new to rails and I am having some trouble getting the Devise authorization plugin working. I can get the login page to display, but when I enter the credentials for a known user (I seeded an account to the database) it just says "Invalid email or password," even though I''m 100% sure I entered the right information, and redirects me to the login form.
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''] =
2011 Aug 08
0
[PATCH] check admin password for upgrade verification
rhbz#719837 Signed-off-by: Joey Boggs <jboggs at redhat.com> --- scripts/ovirt-config-installer.py | 50 +++++++++++++++++-------------------- scripts/ovirt-config-setup.py | 1 - 2 files changed, 23 insertions(+), 28 deletions(-) diff --git a/scripts/ovirt-config-installer.py b/scripts/ovirt-config-installer.py index 637c64c..7c66676 100644 ---