Active Admin Rails 4 inline form

时间:2015-06-15 14:55:10

标签: ruby-on-rails-4 activeadmin arbre

I am using on Rails 4 ActiveAdmin and Money-Rails. Is there a way to have two or more inputs in a single line of text?

para "Please enter the amount"
f.input :amount_due_currency, :label => "Dollars ",:input_html => {:style => 'width:3%'}
para "and"
f.input :amount_due_cents, :label => "cents ", :input_html => {:style => 'width:10%'}
para "to deposit on your account."

the output that I need would look like Please enter the amount __ Dollars and __ cents to deposit on your account.

I tried string interpolation but that fails. Can someone help me please?

1 个答案:

答案 0 :(得分:2)

我相信您可以使用Arbre columns来布局表单。为了更好地控制,我使用CSS来覆盖单个输入的样式,例如:

form.subscription {
  #details {
    li:nth-child(n+2):nth-child(-n+5) {
      display: inline-block;
      width: 48%;
    }
  }