Active Admin Rails 4 inline form

对着背影说爱祢 提交于 2020-01-03 19:56:58

问题


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:


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%;
    }
  }


来源:https://stackoverflow.com/questions/30848373/active-admin-rails-4-inline-form

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!