aitor
October 22, 2007, 5:15pm
1
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 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 %>
aitor
October 22, 2007, 7:30pm
2
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
aitor
October 22, 2007, 11:48pm
3
�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:in
text_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:in
text_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:in
fields_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:in
compile_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:in
render_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:in
render_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:in
render’
/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:in
render’
/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:in
call_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:in
perform_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:in
perform_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:in
send’
/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:in
process_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:in
process’
/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:in
process’
/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:in
process’
/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:in
each’
/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:in
run’
/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:in
new’
/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:in
initialize’
/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:in
run’
/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:in
each’
/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:in
run’
/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:in
load’
/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)
aitor
October 23, 2007, 10:43am
4
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…
–
Sergio Gil Pérez de la Manga
e-mail > [email protected]
blog > http://www.lacoctelera.com/porras