Created
February 20, 2020 19:23
-
-
Save juan-fdz-hawa/03dc8d35b56dc40cc16baf939a0a5b7e to your computer and use it in GitHub Desktop.
Revisions
-
juan-fdz-hawa created this gist
Feb 20, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,22 @@ <%= f.input :author, :as => :grouped_select, :collection => [['Authors', ['Jose', 'Carlos']], ['General', ['Bob', 'John']]], :group_method => :last %> <%= f.input :author, :as => :grouped_select, :collection => Proc.new { [['Authors', ['Jose', 'Carlos']], ['General', ['Bob', 'John']]] }, :group_method => :last %> <%= f.input :author, :as => :grouped_select, :collection => { ['Jose', 'Carlos'] => 'Authors' }, :group_method => :first, :group_label_method => :last %> <%= f.input :author, :as => :grouped_select, :collection => { 'Authors' => ['Jose', 'Carlos'] }, :group_method => :last, :label_method => :upcase, :value_method => :downcase %>