當我將'Required'屬性
添加到html輸入字段時,Rails會在標籤前預先加上一個星號(*)。如何禁用窗體的必填字段中的星號?
有誰知道如何防止這種情況?
出於某種原因Rails的轉換這樣的:
<%= f.input :Company, :input_html => {:value => "", :id => "company_name"}, :label => "company name" %>
到這一點:
<div class="input string required">
<label for="company_name" class="string required">
<abbr title="required">*</abbr> company name</label>
<input type="text" value="" size="50" required="required" name="lead[Company]" id="company_name" class="string required">
</div>
我不喜歡它在一個DIV包裝的一切,並增加了一個abbr元素來參加聚會。
我該如何預防?
你可以發表你正在談論的代碼嗎?這將有所幫助。 –
@Lester Peabody - 我用我的代碼示例更新了這個問題 – vsync
您是否在使用'formtastic'或'simple_form'這樣的寶石?請發佈你的'Gemfile'。 – htanata