Active Scaffold : Add radio buttons to your form ruby on rails ?
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
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
It is nice blog Thank you provide important information and i am searching for same information to save my time Ruby on Rails Online Course Bangalore
ReplyDelete