Sha256: 189e68f087ce6242fb91197dae5cb419e79e8b16a524fcb32a5dcb93f581784b

Contents?: true

Size: 969 Bytes

Versions: 1

Compression:

Stored size: 969 Bytes

Contents

- if params[:action] == 'new' or params[:action] == 'create'
  - url = cavy_create_item_group_path
  - method = 'post'
  - submitText = 'Create'
- else
  - url = cavy_update_item_group_path(@item_group.id)
  - method = 'patch'
  - submitText = 'Update'

= form_for @item_group, url: url, method: method do |f|
  - if @item_group.errors.any?
    #error_explanation
      %h2= "#{pluralize(@item_group.errors.count, "error")} prohibited this admin_item_group from being saved:"
      %ul
        - @item_group.errors.full_messages.each do |msg|
          %li= msg

  .form-group
    = f.label :title, class: 'control-label'
    = f.text_field :title, class: 'form-control'

  .form-group
    = f.label :params, class: 'control-label'
    = f.text_field :param_string, value: "#{@item_group.params.join(',') if @item_group.params.to_s != ''}", placeholder: 'add', class: 'form-control', id: 'item_group_param_string'

  = f.submit submitText, class: 'button small success'

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cavy-0.1.0.beta2 app/views/cavy/item_groups/_form.html.haml