Thursday, September 19, 2024 11:57:24 PM
> settings

Customize


Authenticate

> dashboards_helper.rb
# frozen_string_literal: true

module DashboardsHelper
  def channel_select(name, channels, options = {})
    selected_channel_id = options.delete(:selected)
    raw_options = tag.option(value: "")

    channels.each do |(category, channels)|
      if category
        raw_options += tag.option(value: "", disabled: true, style: "color-dark-gray") do
          "---#{category[:name]}---"
        end
      end

      channels.each do |channel|
        raw_options += tag.option(value: channel[:id], selected: channel[:id] == selected_channel_id) { channel[:name] }
      end
    end

    select_tag(name, raw_options, options)
  end
end
All opinions represented herein are my own
- © 2024 itsthedevman
- build 3c15a1b