In rails app, we would like to specify both rows and value for a text column in simple form. It is easy to do with one:
<%=f.input :column, :input_html => {:rows => 5}%>
<%=f.input :column, :input_html => {:value => 'abc'}%>
We tried the following for 2 attributes:
<%=f.input :column, :input_html => {:rows => 5, :value => 'abc' }%>
Only the :value works and there is only single row instead of 5. The following causes syntax error:
<%=f.input :column, :input_html => {{:rows => 5}, {:value => 'abc' }}%>
What's the right way to specify 2 attributes in input_html? Or it is not doable. Thanks.
UPDATE: Here is the html source for the text column:
<div class="input string optional onboard_engine_config_argument_value"><label class="string optional control-label" for="onboard_engine_config_argument_value">变量值</label><input class="string optional span12" id="onboard_engine_config_argument_value" name="onboard_engine_config[argument_value]" rows="5" size="50" type="text" value=" ....."</div>
The value = "..." is a extremely long text which is a html.erb file and is displayed not in its original order. We are trying to make it displayed in its original order.
column
? It only generates a textarea if the db column istext
(for postgres) – Eyeslandic<%= input :column, input_html: {..}, as: :text %>
– Eyeslandic