You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: fields_helper.rb
    path of file: ./repos/workflow_core/test/dummy/app/helpers
    
    the code of the file until where you have to start completion: # frozen_string_literal: true

module FieldsHelper
  def options_for_field_types(selected: nil)
    options_for_select(Field.descendants.map { |klass| [klass.model_name.human, klass.to_s] }, selected)
  end

  def field_label(form, field_name:)
    field_name = field_name.to_s.split(".").first.to_sym

    form.fields.selec
    
  def field_label(form, field_name:)
    field_name = field_name.to_s.split(".").first.to_sym

    form.fields.select do |field|
      field.name == field_name
    end.first&.label
  end

  def smart_form_fields_path(workflow, form)
    case form
    when Form
      workflow_fields_path(workflow, form)
    when NestedForm
      workflow_nested_form_fields_path(workflow, form)
    else
      raise "Unknown form: #{form.class}"
    end
  end