Method: Alchemy::Ingredient#as_view_component

Defined in:
app/models/alchemy/ingredient.rb

#as_view_component(options: {}, html_options: {}) ⇒ Object

The view component of the ingredient with mapped options.

Parameters:

  • options (Hash) (defaults to: {})
    • Passed to the view component as keyword arguments

  • html_options (Hash) (defaults to: {})
    • Passed to the view component



151
152
153
# File 'app/models/alchemy/ingredient.rb', line 151

def as_view_component(options: {}, html_options: {})
  view_component_class.new(self, **options, html_options: html_options)
end