0
통화로 입력 필드의 텍스트 서식을 지정하고 싶습니다. 발견 된 this 용액. 이 같은
그래서 입력 빌더의 모양을Simple_form as : currency
def input_group(currency, merged_input_options)
"#{@builder.text_field(attribute_name, merged_input_options)} #{currency_addon(currency)}".html_safe
end
하지만 여전히 값의 소수점 형식을 강제해야
= f.input :price, as: :currency, input_html: { value: number_with_precision(f.object.price, precision: 2) }
그것 자체를 진수 숫자를 포맷 할 수있는 것보다 빌더를 개선 할 수 있습니까?
감사