class Asbru::Components::Savage

This module is used to generate react components in the views and loads them via method missing without additional checking. It doesn't offer any benefits over react::rails

Public Class Methods

method_missing(method_id, **opts) click to toggle source
Calls superclass method
# File lib/asbru/components/savage.rb, line 9
def method_missing(method_id, **opts)
  if self.respond_to? :method_id
    super
  end

  name_parts = method_id.to_s.split('_')
  namespace = name_parts.shift
  name = name_parts.map(&:capitalize).join('')

  react_component "#{namespace}.#{name}", opts
end