Sha256: 9c84d75802f7954413ed0921901d81c932b36f5a3bba8ccacbcbfbdcb903bb28

Contents?: true

Size: 1.82 KB

Versions: 57

Compression:

Stored size: 1.82 KB

Contents

<%= form_for @device, html: { class: 'form-horizontal' } do |f| %>
  <div class="page-header nav">
    <%= f.button type: :submit, name: :submit, value: :submit, class: 'btn btn-primary navbar-btn pull-right' do %>
      &#10003; <%= t( @device.new_record? ? '.create' : '.update' ) %>
    <% end %>
    <h3 class='navbar-text'>
      <%= link_to extface.root_path do %>
        Extface<sup>&hearts;</sup>
      <% end %>
      &raquo;
      <%= link_to t('.devices'), devices_path %>
      &raquo; 
      <%= t( @device.new_record? ? '.new' : '.edit') %>
    </h3>
  </div>
  <br />
  <%= render 'object_errors', object: f.object %>

  <%= form_group f, :name, :text_field %>

  <div class="form-group">
    <%= f.label :driver, class: 'col-sm-2 control-label' %>
    <div class='col-sm-10 col-md-8'>
      <% unless @device.driver.blank? || params[:driver_change] %>
        <p class="form-control-static">
          <%= link_to edit_device_path(@device, driver_change: true), class: 'btn btn-danger btn-sm pull-right' do %>
            <%= t('.change_driver') %>
          <% end %>
          <%= @device.driver.class::NAME %>
        </p>
      <% else %>
        <%= f.select :driver_class, options_for_drivers, { include_blank: true }, class: 'form-control' %>
        <% if @device.driver.present? %>
          <span class='text-danger'>Driver change will destroy current driver configuration!</span>
        <% end %>
      <% end %>
    </div>
  </div>
  <%= fields_for :driver do |fd| %>
    <%= driver_settings fd, @device.driver %>
    <%= fields_for :serial_config do |fds| %>
      <div class="form-group">
        <div class='col-sm-offset-2 col-sm-10 col-md-8'>
          <%= render 'extface/serial_configs/settings',  f: fds %>
        </div>
      </div>
    <% end if @device.driver.serial? %>
  <% end if @device.driver.present? %>
<% end %>

Version data entries

57 entries across 57 versions & 1 rubygems

Version Path
extface-0.5.5 app/views/extface/devices/form.html.erb
extface-0.5.4b app/views/extface/devices/form.html.erb
extface-0.5.4a app/views/extface/devices/form.html.erb
extface-0.5.4 app/views/extface/devices/form.html.erb
extface-0.5.3 app/views/extface/devices/form.html.erb
extface-0.5.2 app/views/extface/devices/form.html.erb
extface-0.5.1 app/views/extface/devices/form.html.erb
extface-0.5.0 app/views/extface/devices/form.html.erb
extface-0.4.9 app/views/extface/devices/form.html.erb
extface-0.4.8 app/views/extface/devices/form.html.erb
extface-0.4.7 app/views/extface/devices/form.html.erb
extface-0.4.6k app/views/extface/devices/form.html.erb
extface-0.4.6i app/views/extface/devices/form.html.erb
extface-0.4.6h app/views/extface/devices/form.html.erb
extface-0.4.6g app/views/extface/devices/form.html.erb
extface-0.4.6f app/views/extface/devices/form.html.erb
extface-0.4.6e app/views/extface/devices/form.html.erb
extface-0.4.6d app/views/extface/devices/form.html.erb
extface-0.4.6c app/views/extface/devices/form.html.erb
extface-0.4.6b app/views/extface/devices/form.html.erb