zoukankan      html  css  js  c++  java
  • 国际化配置simple_form

    en:
      simple_form:
        labels:
          defaults:
            pasword: 'default_password'
          aad:
            username: 'User  name'
            pasword: 'Password'
            edit:
              username: 'Change user name'
              pasword: 'Change password'
    
        hints:
          aad:
            username: 'Your username'
            pasword: '****'
    
        placeholders:
          aad:
            username: 'User name to sign in.'
            pasword: 'No special characters, please.'
        include_blanks:
          aad:
            age: 'Rather not to say'
        prompts:
          aad:
            role: 'Select your role'
        required:
          text: 'required'
          mark: '*'
        error_notification:
          default_message: "Please review the problems below:"
    View Code

    /home/pinmi/Godproject/config/locales/simple_form.en.yml

    en:
      simple_form:
        labels:
          defaults:
            pasword: 'default_password'
          aad:
            username: 'User  name'
            pasword: 'Password'
            edit:
              username: 'Change user name'
              pasword: 'Change password'
        options:
          username:
            admin: 'Administrator'
            editor: 'Editor'
        hints:
          email:
            username: 'Your username'
            pasword: '****'
    
        placeholders:
          aad:
            username: 'User name to sign in.'
            pasword: 'No special characters, please.'
        include_blanks:
          aad:
            age: 'Rather not to say'
        prompts:
          aad:
            role: 'Select your role'
        required:
          text: 'required'
          mark: '*'
        error_notification:
          default_message: "Please review the problems below:"
    View Code

    https://github.com/miaomiaotab/simple_form  所有内容

    https://github.com/plataformatec/simple_form/wiki/Custom-inputs-examples  

     /home/pinmi/Godproject/app/inputs/collection_select_input.rb下面可用的函数例子

    http://www.rubydoc.info/github/plataformatec/simple_form/master/frames

    2种自定义:

    1.app下面新建inputs文件夹,新建aa_input.rb文件,在_form.html.erb中,.input组件后可以用as: :aa直接引用

      app/inputs/collection_select_input.rb

    2.config/locales/simple_form.en.yml下对标签,lookup进行修改

  • 相关阅读:
    linux 查看父进程号
    gitlab
    诺基亚C6常识详解
    C#.net书籍列表
    表链接
    Limu:JavaScript的那些书(转载)
    Oracle 多行记录合并/连接/聚合字符串的几种方法
    关于有锁iPhone的常识(转载)
    not in与not exists性能比较
    多表连接查询
  • 原文地址:https://www.cnblogs.com/tabCtrlShift/p/6109763.html
Copyright © 2011-2022 走看看