Creating a custom input

86 views
Skip to first unread message

Brian Jensen

unread,
Aug 1, 2012, 6:15:43 AM8/1/12
to plataformate...@googlegroups.com
Hi,

I have a lot of these horizontal radio button group inputs like this: 

= f.input(:highest_confidence_level, :as => :radio_buttons) do 
        = f.collection_radio_buttons(:highest_confidence_level, PersonalRkaCompletion::FIRST_INTERVAL, :first, :last) {|b| b.label(:class => "inline radio") { b.radio_button + b.text} }

In order to keep it DRY, I would like to convert it into a custom input, so that I could say something in the lines of: f.input :highest_confidence_level, :as => :horizontal_radio_buttons, PersonalRkaCompletion::FIRST_INTERVAL, :first, :last

How can I manage this? I checked on the website and was not able to find the documentation to assist me..

Thanks in advance

Carlos Antonio da Silva

unread,
Aug 10, 2012, 11:37:37 PM8/10/12
to plataformate...@googlegroups.com
Hello,

apparently we're missing some doc improvements on this area, sorry about that. In any case, I'm pretty sure there's a wiki page that has some examples, and there's this fancy uploads repo that may help: https://github.com/apeacox/simple_form_fancy_uploads

Cheers.

-- 
At.
Carlos Antonio

Reply all
Reply to author
Forward
0 new messages