Sha256: 6b0ff70f571864d4ef360b89faf436399ef61e721fbb87c440fab600c3879f82

Contents?: true

Size: 478 Bytes

Versions: 2

Compression:

Stored size: 478 Bytes

Contents

# frozen_string_literal: true

module Phlex::Rails::HTML::MethodMissing
	def method_missing(name, *args, **kwargs, &block)
		return super unless helpers.respond_to?(name)

		const_name = name.to_s.gsub("?", "")
		module_name = Phlex::Rails::Helpers.constants.find { |mod| mod.to_s.underscore.gsub("domid", "dom_id") == const_name }
		return super unless module_name

		raise NoMethodError, "Try including `Phlex::Rails::Helpers::#{module_name}` in #{self.class.name}."
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
phlex-rails-1.2.1 lib/phlex/rails/html/method_missing.rb
phlex-rails-1.2.0 lib/phlex/rails/html/method_missing.rb