-
-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
356ae95
commit fb4adc6
Showing
26 changed files
with
468 additions
and
290 deletions.
There are no files selected for viewing
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<div> | ||
<% unless @skip_label %> | ||
<%= @form.label @attribute %> | ||
<% end %> | ||
<%= @form.select @attribute, @choices, @options, @html_options %> | ||
<%= render partial: "error", locals: { model: @form.object, attribute: @attribute } %> | ||
</div> |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
class SelectComponent < ApplicationComponent | ||
def initialize(config, **kwargs) | ||
@form = config.fetch(:form) | ||
@attribute = config.fetch(:attribute) | ||
@choices = config.fetch(:choices, []) | ||
@options = config.fetch(:options, {}) | ||
@html_options = config.fetch(:html_options, {}) | ||
@skip_label = config.fetch(:skip_label, true) | ||
|
||
super(**kwargs) | ||
end | ||
end |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,13 @@ | ||
<%= form.fields_for(:gizmo) do |furniture_fields| %> | ||
<%= render "text_field", form: furniture_fields, attribute: :channel %> | ||
<%= render "select", form: furniture_fields, attribute: :layout, options: ['video', 'video_with_chat'], include_blank: false %> | ||
|
||
<%= render "select", form: furniture_fields, attribute: :provider, options: ['twitch'], include_blank: false %> | ||
<%= render SelectComponent.new({ | ||
choices: ['video', 'video_with_chat'], | ||
attribute: :layout, | ||
form: furniture_fields, | ||
}) %> | ||
<%= render SelectComponent.new({ | ||
choices: ['twitch'], | ||
attribute: :provider, | ||
form: furniture_fields, | ||
}) %> | ||
<%- end %> |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
<%= render AlertComponent.new(title: "Where are you Ordering from?") do %> | ||
<p>Delivery prices and times vary based upon your location</p> | ||
<%- end %> | ||
|
||
<div class="mt-2 w-full"> | ||
<%= form_with model: cart.location, url: cart.location(child: :delivery_area) do |form| %> | ||
<%= render "select", options: cart.marketplace.delivery_areas.pluck(:label, :id), include_blank: true, attribute: :delivery_area_id, form: form, skip_label: true %> | ||
<%= render SelectComponent.new({ | ||
choices: cart.marketplace.delivery_areas.pluck(:label, :id), attribute: :delivery_area_id, | ||
form: form, | ||
}) %> | ||
<%= form.submit %> | ||
<%- end %> | ||
</div> |
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
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
Oops, something went wrong.