Module: Kube

Defined in:
app/helpers/kube/station/fomantic_form_builder.rb,
lib/kube.rb,
lib/kube/station/engine.rb,
lib/kube/station/version.rb,
app/models/kube/station/config.rb,
app/models/kube/station/cluster.rb,
app/models/kube/station/resource.rb,
app/models/kube/station/schema_fields.rb,
app/channels/kube/station/watch_channel.rb,
app/helpers/kube/station/component_helper.rb,
app/models/kube/station/application_record.rb,
app/controllers/kube/station/list_controller.rb,
app/controllers/kube/station/graph_controller.rb,
app/controllers/kube/station/kinds_controller.rb,
app/controllers/kube/station/groups_controller.rb,
app/controllers/kube/station/approved_controller.rb,
app/controllers/kube/station/clusters_controller.rb,
app/controllers/kube/station/versions_controller.rb,
app/components/kube/station/dynamic_list_component.rb,
app/controllers/kube/station/graph/node_controller.rb,
app/controllers/kube/station/application_controller.rb

Overview

FomanticFormBuilder

A Rails FormBuilder wrapping every helper in Fomantic-UI markup.

Usage in a view:

<%= form_with model: @user, builder: FomanticFormBuilder do |f| %>
  <%= f.text_field :name %>
  <%= f.email_field :email, required: true %>
  <%= f.select :role, [['Admin', 'admin'], ['User', 'user']], dropdown: true %>
  <%= f.check_box :terms, label: 'I agree to the Terms and Conditions' %>
  <%= f.fields_group(equal_width: true) do %>
    <%= f.text_field :first_name %>
    <%= f.text_field :last_name %>
  <% end %>
  <%= f.submit 'Save', color: 'green' %>
<% end %>

Field options (shared across all helpers):

label:        String  – override label text (nil to suppress label)
required:     Boolean – adds "required" class and asterisk
disabled:     Boolean – adds "disabled" class
readonly:     Boolean – adds "read-only" class
inline:       Boolean – label sits beside the input
width:        String  – Fomantic grid column word, e.g. "six", "three"
error:        String  – error message; adds "error" class + inline message
warning:      String  – warning message; adds "warning" class + inline message
hint:         String  – rendered as a small grey note beneath the input
field_class:  String  – extra classes on the wrapping .field div
input_class:  String  – extra classes on the input element itself

Defined Under Namespace

Modules: Station