Module: SimpleAttachments::AttachmentsController::Helpers
- Defined in:
- lib/simple_attachments/attachments_controller.rb
Instance Method Summary collapse
-
#attachment_controller(options = {}) ⇒ Object
Mark controller as controller for attachment resource.
Instance Method Details
#attachment_controller(options = {}) ⇒ Object
Mark controller as controller for attachment resource.
Just put at any place of your controller.
Sometimes you have to specify your resource manually.
:resource => MyNamespace::Attachment
15 16 17 18 19 20 |
# File 'lib/simple_attachments/attachments_controller.rb', line 15 def ( = {}) before_filter :load_attachment, :except => :create self.class.send(:attr_accessor, :attachment_model) self. = ([:resource] or controller_path.classify.constantize) send :include, InstanceMethods end |