Module: AngularSprinkles::Helpers::DirectiveHelper
- Included in:
- AngularSprinkles::Helpers
- Defined in:
- lib/angular_sprinkles/helpers/directive_helper.rb
Instance Method Summary collapse
Instance Method Details
#directive(name, input = {}, options = {}, &block) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/angular_sprinkles/helpers/directive_helper.rb', line 4 def directive(name, input = {}, = {}, &block) content = capture(&block) if block_given? attributes = Directive::Attributes.new([ Directive::Name.new(name), Directive::Input::new(input), Directive::Options::new(.except(:tag)) ], { tag: [:tag], content: content }) content_tag(*attributes.to_content_tag) end |