Slide 53
Slide 53 text
Visibility Extension
module Extensions
module Visibility
def initialize(*args, login_required: false, !**kwargs, &block)
super(*args, !**kwargs, &block)
@login_required = login_required
end
def visible?(context)
return context[:current_user]&.is_a?(User) if @login_required
super
end
end
end