3: def self.included(subclass)
4: subclass.class_eval do
5: include ResourceController::Helpers
6: include ResourceController::Actions
7: extend ResourceController::Accessors
8: extend ResourceController::ClassMethods
9:
10: class_reader_writer :belongs_to, *NAME_ACCESSORS
11: NAME_ACCESSORS.each { |accessor| send(accessor, controller_name.singularize.underscore) }
12:
13: ACTIONS.each do |action|
14: class_scoping_reader action, FAILABLE_ACTIONS.include?(action) ? FailableActionOptions.new : ActionOptions.new
15: end
16:
17: self.helper_method :object_url, :edit_object_url, :new_object_url, :collection_url, :object, :collection,
18: :parent, :parent_type, :parent_object, :parent_model, :model_name, :model, :object_path,
19: :edit_object_path, :new_object_path, :collection_path, :hash_for_collection_path, :hash_for_object_path,
20: :hash_for_edit_object_path, :hash_for_new_object_path, :hash_for_collection_url,
21: :hash_for_object_url, :hash_for_edit_object_url, :hash_for_new_object_url, :parent?,
22: :collection_url_options, :object_url_options, :new_object_url_options
23:
24: end
25:
26: init_default_actions(subclass)
27: end