Please sign in to comment.
Fixes for i18n under Rails 3.1, all tests pass under Rails 3.1.0.rc1 …
…and 3.0.7. * Model_name in Rails 3 can be `author` or `post[author]`. In Rails 3.1 always `author`. Rails 3.1 introduces `builder.parent_builder`, so we use `builder.parent_builder.object` name for the parent (`post`) bit if available, and `f.semantic_fields_for` will pass `:parent_builder` to `f.form_for` as an option to provide similar functionality in Rails 3.0. * The nested translation tests in for the above code really didn't cover the common use cases, so I re-wrote a lot of them, added extras, etc. * Rails 3.1 also doesn't seem to instantiate the nested builder as a Formtastic::FormBuilder if the parent form is using `:post` instead of `@post`, so converted the specs to work with real objects. * The tests for falling back to Rails-style translations didn't make sense to me so I re-wrote them and adding coverage for nesting. Fixes #564
- Loading branch information...
Showing with 50 additions and 13 deletions.