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

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -