Skip to content

Commit

Permalink
use #invert & #to_a to return array of collection
Browse files Browse the repository at this point in the history
  • Loading branch information
JuzerShakir committed Jan 2, 2024
1 parent f418174 commit dc99dbb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/views/sabeels/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= f.error_notification %>
<%= f.input :its %>
<%= f.input :name, placeholder: "Juzer Shabbir Shakir" %>
<%= f.input :apartment, collection: collection_of(Sabeel.apartments), as: :radio_buttons %>
<%= f.input :apartment, collection: Sabeel.apartments.invert.to_a, as: :radio_buttons %>
<%= f.input :flat_no %>
<%= f.input :mobile, placeholder: "9876543210" %>
<%= f.input :email %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/thaalis/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<%= f.input :year, disabled: true %>
<%= f.input :number %>
<%= f.input :size, collection: collection_of(Thaali.sizes), as: :radio_buttons %>
<%= f.input :size, collection: Thaali.sizes.invert.to_a, as: :radio_buttons %>
<%= f.input :total, disabled: action_name == "edit" %>
<%= f.button :submit, action_name: %>
<% end %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/transactions/_form.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<%= f.error_notification %>
<%= f.input :recipe_no %>
<%= f.input :amount, hint: "Amount shouldn't be greater than: ₹#{total_balance}" %>
<%= f.input :mode, collection: collection_of(Transaction.modes), as: :radio_buttons %>
<%= f.input :mode, collection: Transaction.modes.invert.to_a, as: :radio_buttons %>
<%= f.input :date, order: %i[day month year] %>
<%= f.button :submit, action_name: %>
<% end %>
Expand Down

0 comments on commit dc99dbb

Please sign in to comment.