Subhashmohan's Blog

Active Scaffold : Add radio buttons to your form

Posted on: November 18, 2010

The way to add radio buttons to your active scaffold create/update from is as shown below

#Controller

class UsersController < ApplicationController
active_scaffold :user do |config|
config.label = “Users”
config.columns = [:name, :gender]
config.columns[:gender].form_ui = :radio
config.columns[:gender].options[:options] = [[‘Male’, ‘1’], [‘Female’,’2′]]
end
end

Leave a comment

Blog Stats

  • 4,305 hits
November 2010
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
2930  

Categories

Pages