0
我使用Devise并更改路由,以便用户配置文件使用:名称中的URL而不是:id。输入字段强制没有空格,并全部downstick
,所以我有http://localhost:3000/users/testuser
的问题是,当网站上的用户注册时,:name
输入字段允许他们使用空格和大写字母。
如何设置输入以便用户DONT EVEN have the ability to use spaces or Upcase Letters
。
含义,当他打的空间,什么也没有发生在输入..
如果有帮助,我的输入域代码是:
<!-- Username Input-->
<div class="control-group">
<label class="control-label">Username</label>
<div class="controls">
<%= f.input :name, :autofocus => true, label: false %>
<%= f.hint 'No Spaces, all downcase please' %>
</div>
</div>
非常感谢你。