rails-example-how-to-translate-nested-attributes:一个示例 Rails 应用程序,用于学习如何翻译嵌套属性-源码

上传者: 42138716 | 上传时间: 2021-07-21 12:10:33 | 文件大小: 46KB | 文件类型: ZIP
如何翻译错误消息中的嵌套模型属性 问题 我想在父模型的错误中使用本地化来重命名嵌套的多态属性。 例子 用户模型 地址模型,多态 雇主模式 用户有一个邮寄地址,多态地址 用户有一个雇主 用户验证username 、 email 、 mailing_address和employer的presence 。 地址验证street 、 locality 、 region 、 country和postal_code 。 雇主验证name 。 方法 在 config/locales/en.yml 文件中为属性设置新名称: en : activerecord : attributes : address : locality : " City " region : " State " employer : name

文件下载

资源详情

[{"title":"( 66 个子文件 46KB ) rails-example-how-to-translate-nested-attributes:一个示例 Rails 应用程序,用于学习如何翻译嵌套属性-源码","children":[{"title":"rails-example-how-to-translate-nested-attributes-master","children":[{"title":"log","children":[{"title":".keep <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true},{"title":"bin","children":[{"title":"rspec <span style='color:#111;'> 372B </span>","children":null,"spread":false},{"title":"rake <span style='color:#111;'> 90B </span>","children":null,"spread":false},{"title":"setup <span style='color:#111;'> 805B </span>","children":null,"spread":false},{"title":"rails <span style='color:#111;'> 145B </span>","children":null,"spread":false},{"title":"bundle <span style='color:#111;'> 129B </span>","children":null,"spread":false}],"spread":true},{"title":"vendor","children":[{"title":"assets","children":[{"title":"javascripts","children":[{"title":".keep <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true},{"title":"stylesheets","children":[{"title":".keep <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true}],"spread":true}],"spread":true},{"title":"config","children":[{"title":"locales","children":[{"title":"en.yml <span style='color:#111;'> 339B </span>","children":null,"spread":false}],"spread":true},{"title":"database.yml <span style='color:#111;'> 552B </span>","children":null,"spread":false},{"title":"initializers","children":[{"title":"filter_parameter_logging.rb <span style='color:#111;'> 194B </span>","children":null,"spread":false},{"title":"assets.rb <span style='color:#111;'> 486B </span>","children":null,"spread":false},{"title":"wrap_parameters.rb <span style='color:#111;'> 517B </span>","children":null,"spread":false},{"title":"backtrace_silencers.rb <span style='color:#111;'> 404B </span>","children":null,"spread":false},{"title":"session_store.rb <span style='color:#111;'> 166B </span>","children":null,"spread":false},{"title":"cookies_serializer.rb <span style='color:#111;'> 129B </span>","children":null,"spread":false},{"title":"mime_types.rb <span style='color:#111;'> 156B </span>","children":null,"spread":false},{"title":"inflections.rb <span style='color:#111;'> 647B </span>","children":null,"spread":false}],"spread":true},{"title":"application.rb <span style='color:#111;'> 1.39KB </span>","children":null,"spread":false},{"title":"routes.rb <span style='color:#111;'> 1.60KB </span>","children":null,"spread":false},{"title":"boot.rb <span style='color:#111;'> 132B </span>","children":null,"spread":false},{"title":"secrets.yml <span style='color:#111;'> 964B </span>","children":null,"spread":false},{"title":"environment.rb <span style='color:#111;'> 150B </span>","children":null,"spread":false},{"title":"environments","children":[{"title":"test.rb <span style='color:#111;'> 1.71KB </span>","children":null,"spread":false},{"title":"development.rb <span style='color:#111;'> 1.56KB </span>","children":null,"spread":false},{"title":"production.rb <span style='color:#111;'> 3.23KB </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"db","children":[{"title":"seeds.rb <span style='color:#111;'> 343B </span>","children":null,"spread":false},{"title":"migrate","children":[{"title":"20150617004513_create_addresses.rb <span style='color:#111;'> 422B </span>","children":null,"spread":false},{"title":"20150617010833_create_employers.rb <span style='color:#111;'> 252B </span>","children":null,"spread":false},{"title":"20150617004602_create_users.rb <span style='color:#111;'> 236B </span>","children":null,"spread":false}],"spread":true},{"title":"schema.rb <span style='color:#111;'> 1.86KB </span>","children":null,"spread":false}],"spread":true},{"title":"Rakefile <span style='color:#111;'> 249B </span>","children":null,"spread":false},{"title":"app","children":[{"title":"models","children":[{"title":"employer.rb <span style='color:#111;'> 93B </span>","children":null,"spread":false},{"title":"concerns","children":[{"title":".keep <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true},{"title":".keep <span style='color:#111;'> 0B </span>","children":null,"spread":false},{"title":"user.rb <span style='color:#111;'> 334B </span>","children":null,"spread":false},{"title":"address.rb <span style='color:#111;'> 164B </span>","children":null,"spread":false}],"spread":true},{"title":"assets","children":[{"title":"images","children":[{"title":".keep <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true},{"title":"javascripts","children":[{"title":"application.js <span style='color:#111;'> 670B </span>","children":null,"spread":false}],"spread":true},{"title":"stylesheets","children":[{"title":"application.css.scss <span style='color:#111;'> 619B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"controllers","children":[{"title":"concerns","children":[{"title":".keep <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true},{"title":"application_controller.rb <span style='color:#111;'> 204B </span>","children":null,"spread":false}],"spread":true},{"title":"views","children":[{"title":"layouts","children":[{"title":"application.html.haml <span style='color:#111;'> 401B </span>","children":null,"spread":false}],"spread":true},{"title":"application","children":[{"title":"_header.html.haml <span style='color:#111;'> 464B </span>","children":null,"spread":false},{"title":"_flash_area.html.haml <span style='color:#111;'> 34B </span>","children":null,"spread":false},{"title":"_footer.html.haml <span style='color:#111;'> 117B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"mailers","children":[{"title":".keep <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":true},{"title":"helpers","children":[{"title":"application_helper.rb <span style='color:#111;'> 380B </span>","children":null,"spread":false}],"spread":true}],"spread":true},{"title":"Gemfile <span style='color:#111;'> 990B </span>","children":null,"spread":false},{"title":"Gemfile.lock <span style='color:#111;'> 6.49KB </span>","children":null,"spread":false},{"title":".rspec <span style='color:#111;'> 30B </span>","children":null,"spread":false},{"title":"spec","children":[{"title":"models","children":[{"title":"address_spec.rb <span style='color:#111;'> 125B </span>","children":null,"spread":false},{"title":"employer_spec.rb <span style='color:#111;'> 126B </span>","children":null,"spread":false},{"title":"user_spec.rb <span style='color:#111;'> 122B </span>","children":null,"spread":false}],"spread":true},{"title":"rails_helper.rb <span style='color:#111;'> 2.42KB </span>","children":null,"spread":false},{"title":"spec_helper.rb <span style='color:#111;'> 4.29KB </span>","children":null,"spread":false}],"spread":true},{"title":".gitignore <span style='color:#111;'> 474B </span>","children":null,"spread":false},{"title":"lib","children":[{"title":"tasks","children":[{"title":".keep <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":false},{"title":"assets","children":[{"title":".keep <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":false}],"spread":true},{"title":"public","children":[{"title":"404.html <span style='color:#111;'> 1.53KB </span>","children":null,"spread":false},{"title":"robots.txt <span style='color:#111;'> 202B </span>","children":null,"spread":false},{"title":"500.html <span style='color:#111;'> 1.44KB </span>","children":null,"spread":false},{"title":"422.html <span style='color:#111;'> 1.51KB </span>","children":null,"spread":false},{"title":"favicon.ico <span style='color:#111;'> 0B </span>","children":null,"spread":false}],"spread":false},{"title":"README.md <span style='color:#111;'> 6.15KB </span>","children":null,"spread":false},{"title":"config.ru <span style='color:#111;'> 153B </span>","children":null,"spread":false}],"spread":false}],"spread":true}]

评论信息

免责申明

【只为小站】的资源来自网友分享,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,【只为小站】 无法对用户传输的作品、信息、内容的权属或合法性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论 【只为小站】 经营者是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。
本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二条之规定,若资源存在侵权或相关问题请联系本站客服人员,zhiweidada#qq.com,请把#换成@,本站将给予最大的支持与配合,做到及时反馈和处理。关于更多版权及免责申明参见 版权及免责申明