Sha256: 22abe10172a025aebf8b6f44b61afef995508d9f1fcbb633e52d1d30551d9a54
Contents?: true
Size: 992 Bytes
Versions: 3
Compression:
Stored size: 992 Bytes
Contents
# frozen_string_literal: true module Sidekiq module Control module Web module Helpers def link_to(path, text, options={}) %(<a href="#{url_path(path)}"#{to_attributes(options)}>#{text}</a>) end def url_path(path) "#{root_path}#{path.sub(%r{^/}, '')}" end def display_params(params) params.map(&:name).reject { |n| n.start_with?('_') || n.empty? }.tap do |p| return 'None' if p.empty? end.join(', ') end def get_job_params(job, params) return [] if params[:perform].nil? ParamsParser.values(job, params[:perform]) end private def to_attributes(data) # add a space before attributes since this is called without a space between the tag name and the attributes. " #{data.map { |k, v| "#{k}=\"#{v.is_a?(Array) ? v.join(' ') : v}\"" }.join(' ')}" unless data.empty? end end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
sidekiq-control-0.0.12 | lib/sidekiq/control/web/helpers.rb |
sidekiq-control-0.0.11 | lib/sidekiq/control/web/helpers.rb |
sidekiq-control-0.0.10 | lib/sidekiq/control/web/helpers.rb |