Sha256: 1714c95c84332ea55fd38b0ab248e41785245eb0a696309ce136644db92c9a3a

Contents?: true

Size: 1.04 KB

Versions: 25

Compression:

Stored size: 1.04 KB

Contents

# frozen_string_literal: true

module Kadmin
  module ApplicationHelper
    REDMINE_URL = 'https://redmine.offerista.com/projects/apps-services/issues/new'

    # @param [Exception] error used the error to prefill some fields
    # @return [String] URL to submit a new redmine ticket with prefilled params
    def redmine_ticket_link(error)
      issue = {
        subject: "Error in #{controller.class.name} (#{error.class.name})"
      }
      issue[:description] = <<~EOS
        Error while accessing #{request.url} (originally #{request.original_url})

        Error:
          <pre>#{error.message}</pre>

        Description:
          !!! Add a description of what you were doing, what happened, and what did you expect to happen !!!
      EOS

      return "#{REDMINE_URL}?#{{ issue: issue }.to_param}"
    end

    def select2_tag(name, option_tags = nil, options = {}, html_options = {})
      _, html_options = Kadmin::Select2.prepare_form_tag_options(options.dup, html_options.dup)
      return select_tag(name, option_tags, html_options)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
kadmin-1.3.0 app/helpers/kadmin/application_helper.rb
kadmin-1.2.1 app/helpers/kadmin/application_helper.rb
kadmin-1.2.0 app/helpers/kadmin/application_helper.rb
kadmin-1.1.1 app/helpers/kadmin/application_helper.rb
kadmin-1.1.0 app/helpers/kadmin/application_helper.rb
kadmin-1.0.9 app/helpers/kadmin/application_helper.rb
kadmin-1.0.8 app/helpers/kadmin/application_helper.rb
kadmin-1.0.7 app/helpers/kadmin/application_helper.rb
kadmin-1.0.6 app/helpers/kadmin/application_helper.rb
kadmin-1.0.5 app/helpers/kadmin/application_helper.rb
kadmin-1.0.4 app/helpers/kadmin/application_helper.rb
kadmin-1.0.3 app/helpers/kadmin/application_helper.rb
kadmin-1.0.2 app/helpers/kadmin/application_helper.rb
kadmin-1.0.1 app/helpers/kadmin/application_helper.rb
kadmin-1.0.0 app/helpers/kadmin/application_helper.rb
kadmin-0.9.5 app/helpers/kadmin/application_helper.rb
kadmin-0.9.4 app/helpers/kadmin/application_helper.rb
kadmin-0.8.0 app/helpers/kadmin/application_helper.rb
kadmin-0.7.5 app/helpers/kadmin/application_helper.rb
kadmin-0.7.4 app/helpers/kadmin/application_helper.rb