you can do something similar like here: https://github.com/gotar/Internship-range/blob/master/app/models/payment.rb#L9-L11 or extract that method to shooter model and refactor payment view to use it.