volmer/bootsy

View on GitHub
app/helpers/bootsy/application_helper.rb

Summary

Maintainability
A
0 mins
Test Coverage
# frozen_string_literal: true
module Bootsy
  module ApplicationHelper
    def refresh_btn
      link_to t('bootsy.action.refresh'),
              '#refresh-gallery',
              class: 'btn btn-default btn-sm refresh-btn'
    end

    def resource_or_nil(resource)
      resource if resource.present? && resource.persisted?
    end
  end
end