Module: Exposure::Configuration
- Defined in:
- lib/exposure/options.rb,
lib/exposure/configuration.rb
Defined Under Namespace
Modules: Options
Instance Method Summary collapse
-
#expose_many(name, options = {}) ⇒ Object
(also: #expose)
options :nested => false or symbol or array of symbols defaults to false :only => array of REST methods names as symbols to only include defaults to [:index, :show, :new, :create, :edit, :update, :destroy] :except => array of REST methods to exclude defaults to [ ] :formats => array of defaults to [ :html, :xml ].
Instance Method Details
#expose_many(name, options = {}) ⇒ Object Also known as: expose
options :nested => false or symbol or array of symbols
defaults to false
:only => array of REST methods names as symbols to only include
defaults to [:index, :show, :new, :create, :edit, :update, :destroy]
:except => array of REST methods to exclude
defaults to [ ]
:formats => array of
defaults to [ :html, :xml ]
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/exposure/configuration.rb', line 13 def expose_many(name, = {}) @_exposed_resource_name = name @_exposed_resource_options = extend Configuration::Options class << self attr_accessor :resource_name, :resources_name, :resource_chain, :resources_chain, :collection_nesting, :member_nesting, :parent_model end include ActiveSupport::Callbacks include Exposure::Finding include Exposure::Building include Exposure::Flashing include Exposure::Responding include Exposure::Callbacks self.name! self.build_default_finders! self.build_default_builders! extend Patterns::Resources include Patterns::Resources::Actions self.allow_actions! self.allow_formats! define_callbacks(*Patterns::Resources::Callbacks) end |