I believe this issue has come up with another user, and it was closed because it was unreproducible. So, I believe I am reopening the issue.
I am running ruby 1.8.7 with rails 2.3.5, and have installed the validatious gem (0.4.8, from gemcutter), the validation_reflection plugin (0.3.6), and the formtastic gem (0.9.7). However, when I enable the validatious gem, I get the following error (posted at the end of this message).
There are several points I don't understand. First, why is it that validatious is being called when I have not explicitly called ":class => 'validate'" in "form_for". My understanding is that the form is only validated when the form is called with the class "validate". I would have thought validatious would be totally ignored. Second, I don't know why it is failing. I do know that if I comment out the "f.text_area..." field, then the problem goes away. However, this is obviously not a solution.
Any help will be appreciated! This is my first time using validatious, so the problem is mostly likely my setup.
Kevin
stack level too deep
Extracted source (around line #7):
even though I posted this message awhile ago, recently I have tried to debug this and have made some progress. As I stated before, the problem occurs when executing the statement
When this statement is executed, the method "#{field_type}_with_validation" is executed in ./validatious-on-rails/helpers.rb (where "field_type" in this case is "text_area"). This method is the following
I believe that the proper execution of this statement is simply to add validation information to any FormHelper field, and then to execute the rails defined method for the field. However, what is happening is that it is getting caught in an infinite loop (part of the framework trace is at the bottom of this message). Upon execution, the line
is executing the method "#{field_type}_with_validation" once again. It does this every time, hence the infinite loop. Again, according to the "alias_method_chain" method, I believe this line is supposed to instead execute the rails defined f.text_area method.
I would just like to know how to solve this problem. Any help on this would be greatly appreciated. If you need any more information, just let me know.
Hi,
I believe this issue has come up with another user, and it was closed because it was unreproducible. So, I believe I am reopening the issue.
I am running ruby 1.8.7 with rails 2.3.5, and have installed the validatious gem (0.4.8, from gemcutter), the validation_reflection plugin (0.3.6), and the formtastic gem (0.9.7). However, when I enable the validatious gem, I get the following error (posted at the end of this message).
There are several points I don't understand. First, why is it that validatious is being called when I have not explicitly called ":class => 'validate'" in "form_for". My understanding is that the form is only validated when the form is called with the class "validate". I would have thought validatious would be totally ignored. Second, I don't know why it is failing. I do know that if I comment out the "f.text_area..." field, then the problem goes away. However, this is obviously not a solution.
Any help will be appreciated! This is my first time using validatious, so the problem is mostly likely my setup.
Kevin
stack level too deep Extracted source (around line #7):
4:
<%= formatting_note %>
5: <% form_for :comment, :url => person_comments_path(@person) do |f| %> 6:
RAILS_ROOT: /Users/kevinyarritu/projects/nektere/insoshi-private
Application Trace | Framework Trace | Full Trace /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb:195:in
normalize_translation_keys' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb:195:in
map' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb:195:innormalize_translation_keys' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:101:in
send' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:101:inlookup' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n/backend/simple.rb:33:in
translate' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/rails/activesupport/lib/active_support/vendor/i18n-0.1.3/lib/i18n.rb:165:int' /Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.4.8/lib/validatious-on-rails/validatious/validator.rb:206:in
generate_message' /Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.4.8/lib/validatious-on-rails/validatious/validators/length/maximum_validator.rb:11:ininitialize' /Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.4.8/lib/validatious-on-rails/model_validations.rb:255:in
new' /Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.4.8/lib/validatious-on-rails/model_validations.rb:255:inlength_of' /Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.4.8/lib/validatious-on-rails/model_validations.rb:104:in
send' /Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.4.8/lib/validatious-on-rails/model_validations.rb:104:infrom_active_record' /Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.4.8/lib/validatious-on-rails/model_validations.rb:86:in
each' /Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.4.8/lib/validatious-on-rails/model_validations.rb:86:infrom_active_record' /Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.4.8/lib/validatious-on-rails/model_validations.rb:42:in
options_for' /Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.4.8/lib/validatious-on-rails/helpers.rb:13:inattach_validator_for' /Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.4.8/lib/validatious-on-rails/helpers.rb:48:in
text_area_without_validation' /Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.4.8/lib/validatious-on-rails/helpers.rb:48:insend' /Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.4.8/lib/validatious-on-rails/helpers.rb:48:in
text_area_with_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/app/views/people/_wall.html.erb:7:in_run_erb_app47views47people47_wall46html46erb_locals_object_wall' /Users/kevinyarritu/projects/nektere/insoshi-private/app/views/people/_wall.html.erb:5:in
_run_erb_app47views47people47_wall46html46erb_locals_object_wall' /Users/kevinyarritu/projects/nektere/insoshi-private/app/views/people/show.html.erb:7:in_run_erb_app47views47people47show46html46erb' /Users/kevinyarritu/projects/nektere/insoshi-private/app/views/people/show.html.erb:39:in
_run_erb_app47views47people47show46html46erb' /Users/kevinyarritu/projects/nektere/insoshi-private/app/helpers/application_helper.rb:173:incolumn_div' /Users/kevinyarritu/projects/nektere/insoshi-private/app/views/people/show.html.erb:2:in
_run_erb_app47views47people47show46html46erb' /Users/kevinyarritu/projects/nektere/insoshi-private/app/controllers/people_controller.rb:52:in `show'I am having the same problem. Any help on this?
Erwin
Hi Jonas,
even though I posted this message awhile ago, recently I have tried to debug this and have made some progress. As I stated before, the problem occurs when executing the statement
7: <%= f.text_area :body, :rows => 2, :cols => 80 %>
When this statement is executed, the method "#{field_type}_with_validation" is executed in ./validatious-on-rails/helpers.rb (where "field_type" in this case is "text_area"). This method is the following
define_method :"#{field_type}_with_validation" do |_args| args, tail = ::ValidatiousOnRails::Helpers.extract_args!(_args) options = self.attach_validator_for(args.first, args.second, args.extract_options!) self.send :"#{field_type}_without_validation", *((args << options) + tail) end alias_method_chain field_type, :validation
I believe that the proper execution of this statement is simply to add validation information to any FormHelper field, and then to execute the rails defined method for the field. However, what is happening is that it is getting caught in an infinite loop (part of the framework trace is at the bottom of this message). Upon execution, the line
self.send :"#{field_type}_without_validation", *((args << options) + tail)
is executing the method "#{field_type}_with_validation" once again. It does this every time, hence the infinite loop. Again, according to the "alias_method_chain" method, I believe this line is supposed to instead execute the rails defined f.text_area method.
I would just like to know how to solve this problem. Any help on this would be greatly appreciated. If you need any more information, just let me know.
thanks, Kevin
/Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
text_area_without_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
send' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:intext_area_with_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
text_area_without_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:insend' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
text_area_with_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:intext_area_without_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
send' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:intext_area_with_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
text_area_without_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:insend' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
text_area_with_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:intext_area_without_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
send' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:intext_area_with_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
text_area_without_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:insend' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
text_area_with_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:intext_area_without_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
send' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:intext_area_with_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
text_area_without_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:insend' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
text_area_with_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:intext_area_without_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
send' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:intext_area_with_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
text_area_without_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:insend' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in
text_area_with_validation' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb:990:intext_area' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb:990:in
send' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb:990:intext_area' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb:512:in
fields_for' /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/rails/actionpack/lib/action_view/helpers/form_helper.rb:282:in `form_for'This project is since November '09 on ice, and I'm not sure when or if I'll get time to get into it again. :/