grimen / validatious-on-rails

Rails plugin that maps model validations to class names on form elements to integrate with Validatious. IMPORTANT: Project is not maintained anymore.
MIT License
346 stars 13 forks source link

NameError with nested forms #5

Closed grimen closed 14 years ago

grimen commented 14 years ago

In my example...

NameError in Posts#new

Showing app/views/posts/new.html.haml where line #13 raised:

wrong constant name Post[thingAttributes]
Extracted source (around line #13):

10:     
11:   - f.inputs :title => 'Thing', :for => :thing do |g|
12:     = g.input :name
13:     = g.input :about
14:     
15:   - f.buttons do
16:     = f.commit_button 'Create'
RAILS_ROOT: /Users/grimen/Development/examples/test_app

Application Trace | Framework Trace | Full Trace
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/active_support/inflector.rb:361:in `const_defined?'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/active_support/inflector.rb:361:in `constantize'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/active_support/inflector.rb:360:in `each'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/active_support/inflector.rb:360:in `constantize'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.3/lib/active_support/core_ext/string/inflections.rb:162:in `constantize'
/Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.3.5/lib/validatious-on-rails/model_validations.rb:69:in `from_active_record'
/Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.3.5/lib/validatious-on-rails/model_validations.rb:43:in `options_for'
/Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.3.5/lib/validatious-on-rails/helpers.rb:5:in `attach_validator_for'
/Library/Ruby/Gems/1.8/gems/validatious-on-rails-0.3.5/lib/validatious-on-rails/rails/action_view_helpers.rb:21:in `text_field_with_validation'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.3/lib/action_view/helpers/form_helper.rb:943:in `text_field'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.3/lib/action_view/helpers/form_helper.rb:943:in `send'
/Library/Ruby/Gems/1.8/gems/actionpack-2.3.3/lib/action_view/helpers/form_helper.rb:943:in `text_field'
/Library/Ruby/Gems/1.8/gems/justinfrench-formtastic-0.2.4/lib/formtastic.rb:485:in `send'
grimen commented 14 years ago

Received a patch for this; reviewing.

grimen commented 14 years ago

Closed by: http://github.com/grimen/validatious-on-rails/commit/ef768c7bded635d7550e765bd509b4d2646c1738