I’m having trouble displaying a Rails form in a horizontal line.
I have a view, it contains a table, w/ in a table cell I render a partial containing the form I want to be inlined:
View:
<tr>
<td>
<%= @user.name %>
</td>
<td>
<a href="#">Add Item</a>
</td>
<td>
<%= render :partial => '/items/new_item' %>
</td>
</tr>
</table>
Partial (Form):
<%= form_for( Item.new ) do |f| %>
<div class="field">
<%= f.text_field :content %>
</div>
<div class="action">
<%= f.submit "Add Item", :class => 'item_submit' %>
</div>
<% end %>
I have tried:
form{
display:inline;
padding: 0px;
}
And also creating a Unordered list w/in the form, and making the text field and submit button list items, then in the css making the list inline. This didn’t work either.
Thanks for the help!
If I understand you correct, you could try to use span instead of div, or set display:inline for div, not for form.