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

  • 相关阅读:
    转:发一个自己用过的makefile .
    转:TCP/IP协议选项——TCP_KEEPALIVE .
    转:Socket常用选项
    转:sock_ev——linux平台socket事件框架(event loop) .
    Spring Boot logback
    Spring Boot 连接池
    Spring Boot AOP
    spring boot 配置 freemarker
    maven package install deploy
    idea下maven项目打包
  • 原文地址:https://www.cnblogs.com/tabCtrlShift/p/6109763.html
Copyright © 2011-2022 走看看