internetee-registry/app/helpers/auction_helper.rb
2022-04-27 11:57:43 +03:00

19 lines
483 B
Ruby

module AuctionHelper
include ActionView::Helpers::TagHelper
def colorize_auction(auction)
case auction.status
when 'started' then render_status_black(auction.domain)
when 'awaiting_payment' then render_status_black(auction.domain)
else render_status_green(auction.domain)
end
end
def render_status_black(name)
tag.span name.to_s, style: 'color: black;'
end
def render_status_green(name)
tag.span name.to_s, style: 'color: green;'
end
end