Created
September 21, 2016 16:08
-
-
Save wolfravenous/9917870d67982c5979976b550a776fea to your computer and use it in GitHub Desktop.
Scenario: two selectors both with days. User chooses Tuesday in one, Friday in the other. I need to assemble the days Tuesday through Friday as an array and display them all in the view. I store the selection data as first_day_id and last_day_id, but I can not figure out or find an example of how to assemble them as an array for the view.
This file contains 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 characters
<%= simple_form_for(report) do |f| %> | |
<%= f.input :first_day_id, collection: Week.all, as: :grouped_select, group_method: :days %> | |
<%= f.input :last_day_id, collection: Week.all, as: :grouped_select, group_method: :days %> | |
<%= f.button :submit, class: "btn-primary" %> | |
<% end %> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment