-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
stack level too deep #37
Comments
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| 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, /Users/kevinyarritu/projects/nektere/insoshi-private/vendor/plugins/validatious-on-rails/lib/validatious-on-rails/helpers.rb:47:in |
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. :/ |
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:
7: <%= f.text_area :body, :rows => 2, :cols => 80 %>
8:
9:
10: <%= submit_tag "Submit", :class => "button" %>
Trace of template inclusion: app/views/people/show.html.erb
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:in
normalize_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:in
lookup' /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:in
t' /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:in
initialize' /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:in
length_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:in
from_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:in
from_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:in
attach_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:in
send' /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:in
column_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'
The text was updated successfully, but these errors were encountered: