> Are you sure the problem isn't a few lines further up ? If either of
> those return false statements are triggered then save won't yield to
> its block. Would it not be simpler to use the return value from save
> rather than this block approach?
>

The block approach was originally implemented by Binarylogic and the
console logs show that even when the input is invalid (thus there's an
error set for the user.openid_identifier) the save method block is
yielded.

Here's the console log for an invalid output:

Processing UsersController#create (for 127.0.0.1 at 2010-02-02
16:32:23) [POST]
  Parameters: {"commit"=>"Create", "action"=>"create",
"authenticity_token"=>"Q/IDQDxzVUdbCO/fDp1Swgei+hmXJbadWrfRknxxID8=",
"controller"=>"users", "user"=>{"password_confirmation"=>"[FILTERED]",
"username"=>"", "openid_identifier"=>"..", "password"=>"[FILTERED]",
"email"=>""}}
  User Load (0.2ms)   SELECT "users".id FROM "users" WHERE (LOWER
("users"."username") = '') LIMIT 1
  User Load (0.1ms)   SELECT "users".id FROM "users" WHERE (LOWER
("users"."email") = '') LIMIT 1
  User Load (0.1ms)   SELECT "users".id FROM "users" WHERE
("users"."openid_identifier" = '..') LIMIT 1
  CACHE (0.0ms)   SELECT "users".id FROM "users" WHERE (LOWER
("users"."email") = '') LIMIT 1
  CACHE (0.0ms)   SELECT "users".id FROM "users" WHERE (LOWER
("users"."username") = '') LIMIT 1
  User Load (0.1ms)   SELECT "users".id FROM "users" WHERE
("users"."persistence_token" =
'8e5760baab016edfbf616d742624371e8a2634e4e337200cbe49e11bc32ff82cdad306b6c3ae1fcd4eb76a28cfde0cc70dcbdf6070a4c511f75b510076b45f7b')
LIMIT 1
  User Load (0.1ms)   SELECT "users".id FROM "users" WHERE
("users"."single_access_token" = 'IM0pySoQJaARTzKFYEHc') LIMIT 1
Rendering template within layouts/application
Rendering users/new
Rendered users/_form (15.6ms)
Completed in 25ms (View: 17, DB: 0) | 200 OK [http://localhost/users]

Before the rendering I've traced the request in debug mode and created
a gist with the output of my actions, where clearly the request to
render the 'new' action is processed and the errors are correctly set
(by the save method): http://gist.github.com/292936

Any idea of what might be causing this issue? I can try to debug the
render method but it's just "to internal to my current rails
knowledge" :)

Best regards,
DBA

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" 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/rubyonrails-talk?hl=en.

Reply via email to