ruby-on-rails-4activeadminarbre

Active Admin Rails 4 inline form


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?


Solution

  • I believe you can use Arbre columns to layout a form. For greater control I use CSS to override the styling of individual inputs, eg:

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