Sha256: 3693709a0706455162f29cded6233dd69bbb9e57c142ce5b76a7b6b405b6f440

Contents?: true

Size: 653 Bytes

Versions: 10

Compression:

Stored size: 653 Bytes

Contents

require 'iord/controller'
require 'iord/paginate'

class CategoriesController < ApplicationController
  include Iord::Controller
  include Iord::Paginate

  def index_attrs
    %i(name)
  end

  def show_attrs
    %i(name) + [
      {
        array: :products,
        attr: {
          attrs: %i(name reference quantity)
        }
      }
    ]
  end

  def form_attrs
    %i(name) + [
      {
        attr: :products,
        fields: [
          {
            attr: :_id,
            hidden: :true,
            field: [:hidden_field, :_id],
            not_new_record: true
          }
        ] + %i(name reference quantity)
      }
    ]
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
iord-1.2.2 test/dummy/app/controllers/categories_controller.rb
iord-1.2.1 test/dummy/app/controllers/categories_controller.rb
iord-1.2.0 test/dummy/app/controllers/categories_controller.rb
iord-1.1.3 test/dummy/app/controllers/categories_controller.rb
iord-1.1.2 test/dummy/app/controllers/categories_controller.rb
iord-1.1.1 test/dummy/app/controllers/categories_controller.rb
iord-1.1.0 test/dummy/app/controllers/categories_controller.rb
iord-1.0.3 test/dummy/app/controllers/categories_controller.rb
iord-1.0.2 test/dummy/app/controllers/categories_controller.rb
iord-1.0.1 test/dummy/app/controllers/categories_controller.rb