Sha256: 5b4f1934dd611d667833e0a7428745cd19a89869a5aa095e78dcb9f002ff90a3

Contents?: true

Size: 481 Bytes

Versions: 5

Compression:

Stored size: 481 Bytes

Contents

class BookGridWithDefaultValues < Netzke::Basepack::Grid
  def configure(c)
    c.model = "Book"
    c.title = "Books"
    super
  end

  column :title do |c|
    c.default_value = "Lolita"
  end

  column :author__last_name do |c|
    c.default_value = Author.first.id
  end

  column :exemplars do |c|
    c.default_value = 100
  end

  column :digitized do |c|
    c.default_value = true
  end

  def columns
    [ :title, :author__last_name, :exemplars, :digitized ]
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
netzke-basepack-0.8.4 test/basepack_test_app/app/components/book_grid_with_default_values.rb
netzke-basepack-0.8.3 test/basepack_test_app/app/components/book_grid_with_default_values.rb
netzke-basepack-0.8.2 test/basepack_test_app/app/components/book_grid_with_default_values.rb
netzke-basepack-0.8.1 test/basepack_test_app/app/components/book_grid_with_default_values.rb
netzke-basepack-0.8.0 test/basepack_test_app/app/components/book_grid_with_default_values.rb