2017-09-05 154 views
0
<%= form_for(:description, url:{action:'create'}) do |f| %> 
    <div class="row"> 
     <div class="input-field col s6"> 
     <%= f.text_field :position, data-length:30 %> 
     <label for="position">Position</label> 
     </div> 
    </div> 
<% end %> 

而我得到的誤差,Ruby on Rails的助手HTML5

語法錯誤,意想不到keyword_do_block d =(f.text_field:位置, 做數據長度:30); @ output_buf ^/home/whitehat/Documents/Books/Web 開發/ Ruby On Rails/Projects/free-lance/dressing-shop/app/views/products/new.html.erb:39: 語法錯誤,意外tSYMBEG,期待keyword_do或'{'或'(' ld:position,do data-length:30); @ output_buffer.safe_appen^

回答

0

變化data-length'data-length'

<%= f.text_field :position, 'data-length': 30 %> 
+0

不客氣。 –