Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
1 parent
f7d9cfd
commit b82fd53
Showing
3 changed files
with
50 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters