Skip to content

Commit

Permalink
Merge pull request #3422 from manyfold3d/checkbox-helper
Browse files Browse the repository at this point in the history
Add a form helper for checkbox inputs
  • Loading branch information
Floppy authored Jan 17, 2025
2 parents 9780d6e + 1a21f33 commit b94baa4
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,19 @@ def rich_text_input_row(form, name, options = {})
end
end

def checkbox_input_row(form, name, options = {})
content_tag :div, class: "row mb-3 input-group" do
safe_join [
form.label(name, class: "col-sm-2 col-form-label"),
content_tag(:div, class: "col-sm-10") do
content_tag(:div, class: "form-switch") do
form.check_box name, class: "form-check-input form-check-inline"
end
end
]
end
end

def nav_link(ico, text, path, options = {})
link_to(
safe_join(
Expand Down

0 comments on commit b94baa4

Please sign in to comment.