tryzealot/zealot

View on GitHub
app/views/channels/_form.html.slim

Summary

Maintainability
Test Coverage
ruby:
  form_url = new_or_create_route? ? app_scheme_channels_path(@scheme.app, @scheme) : app_scheme_channel_path(@app, @scheme, @channel)

.col-md-12
  .card
    .card-header
      h3.card-title
        = @title
      .card-tools
        a href="#{app_path(@scheme.app)}"
          i.icon.far.fa-list-alt
          = t('links.back_to_list')
    .card-body
      = simple_form_for(@channel, url: form_url) do |f|
        = f.error_notification

        input name="referer_url" value="#{request.referer}" type="hidden"
        = f.input :scheme_id, as: :hidden, input_html: { value: params[:scheme_id] }
        = f.input :name, required: true
        = f.input :device_type, collection: Channel.device_types, label_method: :last, value_method: :first, selected: @channel.device_type ? @channel.device_type : Channel.device_types.first
        = f.input :bundle_id
        = f.input :git_url
        = f.input :slug
        = f.input :password, input_html: { type: 'input', value: @channel.password }
        - if params[:action] != 'new'
          = f.input :key, input_html: { disabled: true }
        = f.button :submit