-
Notifications
You must be signed in to change notification settings - Fork 494
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DRY up selectize users helpers #2074
Conversation
bb29162
to
d655247
Compare
Codecov Report
@@ Coverage Diff @@
## master #2074 +/- ##
==========================================
+ Coverage 83.86% 83.87% +<.01%
==========================================
Files 141 141
Lines 4698 4700 +2
==========================================
+ Hits 3940 3942 +2
Misses 758 758
Continue to review full report at Codecov.
|
This may make #2008 easier to resolve ;-) |
app/views/booths/_form.html.haml
Outdated
@@ -24,7 +24,6 @@ | |||
:javascript | |||
$(document).ready(function() { | |||
$('#booth_responsible_ids').selectize({ | |||
plugins: ['remove_button'], | |||
minItems: 2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how is that related? 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch, thanks!
app/helpers/application_helper.rb
Outdated
form.input :speakers, as: :select, | ||
collection: options_for_select(users.map {|user| ["#{user[1]} (#{user[2]}) #{user[3]}", user[0]]}, @event.speakers.map(&:id)), | ||
include_blank: false, label: 'Speakers', input_html: { class: 'select-help-toggle', multiple: 'true' } | ||
# users = User.active.pluck(:id, :name, :username, :email).map { |user| [user[0], user[1].blank? ? user[2] : user[1], user[2], user[3]] }.sort_by { |user| user[1].downcase } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shouldn't those comments be removed as well? 😕
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes... sorry I forgot to remove those.
(cherry picked from commit eb38ddc)
d655247
to
d286191
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😉
Thanks! |
(cherry picked from commit eb38ddc)
Checklist
master
branch.Short description of what this resolves/which issues does this fix?:
selectize...
helpers had duplicate code.Changes proposed in this pull request:
selectize...
helpers.