Sha256: 1c60ef548b7de9a77e6bfda4895936a20268897950b0492bd544fcebb3abb1a2

Contents?: true

Size: 577 Bytes

Versions: 4

Compression:

Stored size: 577 Bytes

Contents

# Provides a resource_controller preconfigured with options you want 99% of the time. Used by most controllers that do CRUD.
# origin: RM
module BoringControllerTrait
  as_trait do |*options|
    
    options = options.first || {}

    options[:singleton] ? resource_controller(:singleton) : resource_controller

    does 'boring_controller_trait/flash'
    does 'boring_controller_trait/deletable' unless options[:destroy_is_permanent]
    does 'boring_controller_trait/index', options unless options[:singleton]
    does 'boring_controller_trait/helpers', options

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
serum-rails-0.2.1 spec/test_apps/rails-2-3/app/controllers/shared/boring_controller_trait.rb
serum-rails-0.2.0 spec/test_apps/rails-2-3/app/controllers/shared/boring_controller_trait.rb
serum-rails-0.1.1 spec/test_app/app/controllers/shared/boring_controller_trait.rb
serum-rails-0.1.0 spec/test_app/app/controllers/shared/boring_controller_trait.rb