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进行修改

  • 相关阅读:
    解决Xcode 证书过期问题
    Parallel Desktop 问题汇总
    CMS系统学习笔记
    git pull报错 error: Your local changes to the following files would be overwritten by merge
    Mac安装Homebrew
    使用nvm-windows安装NodeJs遇到的问题: Could not retrieve https://nodejs.org/dist/latest/SHASUMS256.txt.
    HTB-靶机-Luke
    HTB-靶机-Fortune
    HTB-靶机-Ypuffy
    HTB-靶机-Sunday
  • 原文地址:https://www.cnblogs.com/tabCtrlShift/p/6109763.html
Copyright © 2011-2022 走看看