Using dry monads mixins in Rails views

I create a shortcut constant for these situations. T is my Types shortcut, M is my Dry::Monads shortcut. You could just reference M::Failure() as you would with the mixin method.

Side note: as I mentioned elsewhere, I don’t think using Monads in view logic is a good idea for the same reasons why using branching logic is a bad idea.

1 Like