Add attribute to rails helper text field?

北城余情 提交于 2019-12-01 03:19:30

Just do:

<%= f.email_field :login, :novalidate => 'novalidate' %>

UPDATE -- If you want to add an attribute to the FORM tag, the syntax is slightly different:

<%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:novalidate => 'novalidate'}) do |f| %>

RICH EDITOR - such as the stack over flow will be better for you.

Tinymce is a great rich editor.

check out this website: http://richonrails.com/articles/adding-tinymce-to-your-rails-application

When you follow the instructions make sure you do the following also.

  1. run gem install tinymce-rails on your command prompt
  2. Add <%= tinymce %> on the bottom of your footer or footers or your layouts and not your forms (I have my footer as a partial, so this text is in every page assuming that is what you want.)
  3. Make sure you restart your serverr or else you will get all type of errors.

Hope this helps answer your questions

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!