Sha256: f1f17e3d41a356930b0d8ac1a203c482b33bbaf77c4eb517457f3c0666926fc5

Contents?: true

Size: 554 Bytes

Versions: 1

Compression:

Stored size: 554 Bytes

Contents

module RailsPerformanceHelper
  def round_it(value)
    return nil unless value
    return value if value.is_a?(Integer)

    value.nan? ? nil : value.round(2)
  end

  def statistics_link(title, report, group)
    options = case report.group
    when :controller_action_format
      ca = group.split("|")
      c, a = ca[0].split("#")
      {
        controller_eq: c,
        action_eq: a,
        format_eq: ca[1]
      }
    else
      {}
    end

    link_to title, rails_performance_path(options), target: '_blank'
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rails_performance-0.0.1.4 app/helpers/rails_performance_helper.rb