On Lunes, 15 de Noviembre de 2010 09:38:50 tone_lau escribió:
> new user create : active_scaffold
> the basic create user : authlogic
> 
> class Admin::UsersController < ApplicationController
>   active_scaffold :user do |config|
>     config.columns = [:username,:email,:role]
>     config.list.columns =
> [:username, :email, :created_at, :updated_at]
>     config.create.columns =
> [:username,:email,:crypted_password, :password_salt,:role]
> 
> config.update.columns.exclude :crypted_password,:password_salt,
> :persistence_token #config.actions.swap :search, :live_search
>     config.search.live = true
>     config.list.per_page = 12
>   end
> 
> under admin create new user just have    2 errors
> 
> * Password is too short (minimum is 4 characters)
> * Password confirmation is too short (minimum is 4 characters)
> but the password is not short ,I use "123123" is also the 2 errors,

Really your error is authlogic understanding. I don't know authlogic, but most 
user plugins generate crypted_password with password attribute, and require 
password_confirmation be the same as password, so you mustn't show crypted 
password in a form. You should add password and password_confirmation to 
config.columns and config.create.columns, instead of crypted_password and 
salt_password.

> 
> the create form just have a "creat" button
> ---------------------------------------------------------------------------
> ---------------------------------------------------------------------------
> ------------------------------------------- Processing
> Admin::UsersController#create (for 127.0.0.1 at 2010-11-15 16:20:19)
> [POST]
>   Parameters: {"commit"=>"Create",
> "authenticity_token"=>"AOJXPA5tBU09zkyScIVfinOAnvYQCelOKWW5Fx4HeO0=",
> "record"=>{"crypted_password"=>"123123", "role"=>"user",
> "username"=>"diff", "password_salt"=>"123123",
> "email"=>"[email protected]"}}

123123 should be in password and password_confirmation attributes, you 
shouldn't set crypted_password and password_salt.

> 
> SQL (0.1ms)   BEGIN
>   User Load (0.3ms)   SELECT `users`.id FROM `users` WHERE
> (LOWER(`users`.`email`) = BINARY '[email protected]') LIMIT 1
>   User Load (0.2ms)   SELECT `users`.id FROM `users` WHERE
> (LOWER(`users`.`username`) = BINARY 'diff') LIMIT 1
>   User Load (0.1ms)   SELECT `users`.id FROM `users` WHERE
> (`users`.`persistence_token` = BINARY
> '684d82118da9cf81c63d55fce0e3ce8fa9295d9688a899ac5a7ebcf4cae254d4a139464a75
> 527c9f839e28d695b69a3041f536e2f926a0fd7a7bf13d28093320') LIMIT 1
>   SQL (0.1ms)   COMMIT

-- 
Sergio Cambra .:: entreCables S.L. ::.
Mariana Pineda 23, 50.018 Zaragoza
T) 902 021 404 F) 976 52 98 07 E) [email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/activescaffold?hl=en.

Reply via email to