Skip to content

Instantly share code, notes, and snippets.

View st8998's full-sized avatar

Ivan Efremov st8998

View GitHub Profile
module ApplicationHelper
def define_helper name, force = false, &block
if !respond_to?(name) || force
self.class.send(:define_method, name) do |*args|
capture(*args, &block)
end
else
raise 'Your inline helper conflicts with already defined helper'
end