view app/helpers/application_helper.rb @ 503:2392b86711a1

Remove standalone option I reverted the bundler require option during upgrade but the custom group isn't relevant anymore anyway.
author nanaya <me@nanaya.net>
date Mon, 16 Dec 2024 01:15:49 +0900
parents 68231013b01b
children
line wrap: on
line source

module ApplicationHelper
  def html_title
    base_title = "Zeropaste"
    if content_for? :title
      "#{content_for(:title)} | #{h base_title}".html_safe
    else
      base_title
    end
  end

  def error_class(object, attribute)
    "is-invalid" if object.errors.include? attribute
  end

  def with_host(url)
    return url if url[0] != "/"

    "#{request.protocol}#{request.host_with_port}#{url}"
  end
end