简体   繁体   中英

Rails, Formtastic - model name not showing on form buttons

I have just deployed an existing app to a new server and have noticed that where model names are automatically generated (by Formtastic) it instead outputs {{model}} rather than the expected name.

For example, in the linked image it should read 'Create Category' but instead reads 'Create {{model}}' https://skitch.com/simon180/rr4w9/example

I don't know where to start in figuring what causes this.

Rails version is 2.3.5 (vendored) and gems vendored too.

Any suggestions gratefully received!

Thanks

Simon

Have a look in the formtastic gem, depending on what version you have, the file will be

/lib/formtastic/i18n.rb

or

formtastic/lib/locale/en.yml

it should have something like this:

'Create %{model}'

but yours will have:

'Create {{model}}'

Thats the old format. Change occurrences of {{foo}} to %{foo}

or

Updating the formtastic gem should do the trick

Another option is to downgrade the i18n gem to 0.4.1 this problem will disappear.

The problem is with the i18n gem version. From version 0.4.1 on, the way of accessing variables isn't {{variable}} anymore.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM