Changing ruby generated select to checkboxes -
im new ruby, working on new clients project , im wanting change current dropdown have multiple checkboxes not sure how or if possible.
current code is:
<%= f.label :section,t(:pick_admin_options)%><br/> <% options =  (@admin_permission.action == :edit) ? section_options('edit') : section_options %> <%= f.select :section, options_for_select(options,:selected => @admin_permission.section) %> anyone have ideas? appreciated in advance!
thanks
i think, should trick:
<%= f.input :sections, :as => :check_boxes, :collection =>  ((@admin_permission.action == :edit) ? section_options('edit') : section_options) %> thanks
Comments
Post a Comment