Active Admin Rails 4内联表单 [英] Active Admin Rails 4 inline form

查看:58
本文介绍了Active Admin Rails 4内联表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Rails 4 ActiveAdmin和Money-Rails上使用。有没有办法在一行文本中包含两个或多个输入?

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?

推荐答案

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

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

这篇关于Active Admin Rails 4内联表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆