0
對於嵌套表單,我使用寶石coocon。 我有一個視圖如何在嵌入div塊的輸入標籤之後在一行中顯示按鈕?
_poll_item_field.html.erb
.poll_row
.poll_item
= f.input :answer, input_html: { class: 'ctrlenter expanding' }, label: false, placeholder: 'Введите вариант ответа'
= button_tag 'Up', class: 'btn btn-bg', id: 'up_id', type: 'button'
= button_tag 'Down', type: 'button', class: 'btn btn-bg', id: 'down_id'
= link_to_remove_association "delete", f, { wrapper_class: 'poll_item' }
生成的HTML
<div class="poll_item">
<div class="control-group string required blog_post_poll_poll_items_answer">
<div class="controls"><input class="string required ctrlenter expanding" display="inline" id=" blog_post_poll_attributes_poll_items_attributes_0_answer" margin="0" name="blog_post[poll_attributes][poll_items_attributes][0][answer]" placeholder="Введите вариант ответа" size="50" type="text">
</div>
</div>
<button class="btn btn-bg" display="inline" id="up_id" name="button" type="button">up</button>
<button class="btn btn-bg" display="inline" id="down_id" name="button" type="button">down</button>
<input id="blog_post_poll_attributes_poll_items_attributes_0__destroy" name="blog_post[poll_attributes][poll_items_attributes][0][_destroy]" type="hidden" value="false"><a href="#" class="remove_fields dynamic" data-wrapper-class="poll_item">delete</a>
</div>
有與類輸入字段ctrlenter擴大,後兩個按鈕「上」和「下」添加。此時,這些按鈕將顯示在下一行的輸入字段後面,並且必須將它們與輸入字段放在一行中。爲了實現這一點,我應該添加哪些樣式?
我_layout.sass
#up_id, #down_id
display: inline-block
添加,但不wotk
嘗試'顯示:inline-block的重要' –
我tryed。不工作 –