Add helper for event switch checkboxes
This commit is contained in:
parent
ad19a6d753
commit
0848df6948
3 changed files with 25 additions and 27 deletions
|
|
@ -156,6 +156,27 @@ module EventsHelper
|
|||
active_dropdown(selection, options)
|
||||
end
|
||||
|
||||
def event_switch_checkbox(event, attribute, conference_id)
|
||||
check_box_tag(
|
||||
conference_id,
|
||||
event.id,
|
||||
event.send(attribute),
|
||||
url: admin_conference_program_event_path(
|
||||
conference_id,
|
||||
event,
|
||||
event: { attribute => nil }
|
||||
),
|
||||
method: :patch,
|
||||
class: 'switch-checkbox',
|
||||
data: {
|
||||
size: 'small',
|
||||
off_color: 'warning',
|
||||
on_text: 'Yes',
|
||||
off_text: 'No'
|
||||
}
|
||||
)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def active_dropdown(selection, options)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue