Sha256: d0459eca6c7f54318cd92d34fb6093a63bc0071f32033a1e64b906e8aee5fb6c
Contents?: true
Size: 544 Bytes
Versions: 17
Compression:
Stored size: 544 Bytes
Contents
require 'ui_bibz/utils/internationalization' module UiBibz::Ui class Base include ActionView::Helpers include Rails.application.routes.url_helpers attr_accessor :output_buffer # To know if translation missing def i18n_set? key I18n.t key, :raise => true rescue false end # Add "id" in url to match with current record def inject_url url, record url.gsub(/(\/id\/?)/, "/#{ record.id }/") end def generate_id name = nil "#{ name || 'id' }-#{ Random.rand(99999) }" end end end
Version data entries
17 entries across 17 versions & 1 rubygems