Plugin LiveValidation (undefined method)

Andaba probando el plugin live_validations, pero me lanza el
error undefined method `live_validations’ for NilClass:Class

creo que es debido a la linea que hay en lib > form_helpers.rb
alias_method_chain :text_field, :live_validations

aun así tampoco he conseguido que me funcionase :frowning: he seguido el
“little” HOWTO pero no ha habido manera

Modelo

class User < ActiveRecord::Base

validates_presence_of :email
validates_presence_of :password
validates_presence_of :password_confirmation
validates_format_of :email, :with =>
/^([^@\s]+)@((?:[-a-z0-9]+.)+[a-z]{2,})$/i

end

Vista

<% form_for :user, :url => users_path do |f| %>
email <%= f.text_field :email %>


password <%= f.password_field :password %>


password_confirmation <%= f.password_field :password_confirmation %>
<% end %>

On 10/22/07, Fernandez S. [email protected] wrote:

class User < ActiveRecord::Base
<% form_for :user, :url => users_path do |f| %>
email <%= f.text_field :email %>


password <%= f.password_field :password %>


password_confirmation <%= f.password_field :password_confirmation %>
<% end %>

Hola,

¿Puedes pasar algún dato más (versión de Rails, emnsaje de error
completo, etc.)? No he conseguido reproducir el error…


Sergio Gil Pérez de la Manga
e-mail > [email protected]
blog > http://www.lacoctelera.com/porras

�Puedes pasar alg�n dato m�s (versi�n de Rails, emnsaje de error
completo, etc.)? No he conseguido reproducir el error…

hola, lo había probado con la versión pre-2, y al no funcionar lo probé
con la versión 1.2.3 obteniendo en ambas versiones el mismo error.
te pongo el resultado que aparece en el development.log

voy a seguir probando a ver si consigo hacerlo funcionar.

Gracias

Processing RootController#index (for 127.0.0.1 at 2007-10-22 23:40:19)
[GET]
Session ID: c3c8da938950135979f22a0ce0bba380
Parameters: {“action”=>“index”, “controller”=>“root”}
Rendering within layouts/application
Rendering root/index

ActionView::TemplateError (undefined method `live_validations’ for
NilClass:Class) on line #5 of app/views/root/index.rhtml:
2:
3: <% form_for(:user, :url => users_path) do |f| %>
4:
5: name: <%= f.text_field :name %>

6: email: <%= f.text_field :email %>

7: password: <%= f.password_field :password %>

8: password_confirmation: <%= f.password_field :password_confirmation
%>

#{RAILS_ROOT}/vendor/plugins/livevalidation/lib/form_helpers.rb:14:in 

live_validation' #{RAILS_ROOT}/vendor/plugins/livevalidation/lib/form_helpers.rb:6:intext_field’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/form_helper.rb:430:in
send' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/form_helper.rb:430:intext_field’
#{RAILS_ROOT}/app/views/root/index.rhtml:5:in
_run_rhtml_47app47views47root47index46rhtml' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/form_helper.rb:151:infields_for’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/form_helper.rb:127:in
form_for' #{RAILS_ROOT}/app/views/root/index.rhtml:3:in_run_rhtml_47app47views47root47index46rhtml’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:326:in
send' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:326:incompile_and_render_template’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:301:in
render_template' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:260:inrender_file’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:806:in
render_file' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:711:inrender_with_no_layout’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/layout.rb:247:in
render_without_benchmark' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:50:inrender’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/1.8/benchmark.rb:293:in
measure' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:50:inrender’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1101:in
perform_action_without_filters' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:632:incall_filter’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:619:in
perform_action_without_benchmark' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:inperform_action_without_rescue’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/1.8/benchmark.rb:293:in
measure' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:inperform_action_without_rescue’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/rescue.rb:83:in
perform_action' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:insend’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in
process_without_filters' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:inprocess_without_session_management_support’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in
process' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:inprocess’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in
dispatch' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:78:inprocess’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:in
synchronize' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/rails.rb:76:inprocess’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:618:in
process_client' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:ineach’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:617:in
process_client' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:inrun’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
initialize' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:innew’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:736:in
run' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:ininitialize’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:in
new' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel.rb:720:inrun’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:271:in
run' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:ineach’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/configurator.rb:270:in
run' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:127:inrun’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/lib/mongrel/command.rb:211:in
run' /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/mongrel-1.0.1/bin/mongrel_rails:243 /Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/bin/mongrel_rails:16:inload’
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/bin/mongrel_rails:16

Rendering
/Applications/Locomotive2/Bundles/standardRailsMar2007.locobundle/powerpc/lib/ruby/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/templates/rescues/layout.rhtml
(500 Internal Error)

On 10/22/07, Fernandez S. [email protected] wrote:

hola, lo había probado con la versión pre-2, y al no funcionar lo probé
con la versión 1.2.3 obteniendo en ambas versiones el mismo error.
te pongo el resultado que aparece en el development.log

voy a seguir probando a ver si consigo hacerlo funcionar.

Gracias

Hola de nuevo,

¿Te importa ponerte en contacto conmingo en sgilperez en gmail punto
com (por sacar ruido de la lista)? Sigo sin poder reproducir el
error… :frowning:


Sergio Gil Pérez de la Manga
e-mail > [email protected]
blog > http://www.lacoctelera.com/porras