Module: RailsMetricsHelper::Links
- Included in:
- RailsMetricsHelper
- Defined in:
- app/helpers/rails_metrics_helper.rb
Instance Method Summary collapse
-
#add_action_links!(metric) ⇒ Object
Add action icons to the current page.
-
#link_to_image_unless_current(icon, path, title) ⇒ Object
Links to image inside rails_metrics if the given path it’s not the current page using the given title.
- #nagivation_links ⇒ Object
Instance Method Details
#add_action_links!(metric) ⇒ Object
Add action icons to the current page.
127 128 129 130 131 132 133 |
# File 'app/helpers/rails_metrics_helper.rb', line 127 def add_action_links!(metric) concat link_to_image_unless_current(:chart_pie, chart_rails_metric_path(metric.request_id), "Chart") concat link_to_image_unless_current(:page_white_go, rails_metric_path(metric), "Show") form_tag(rails_metric_path(metric), :method => :delete) do image_submit_tag "rails_metrics/page_white_delete.png", :onclick => "return confirm('Are you sure?')", :alt => "Delete", :title => "Delete" end end |
#link_to_image_unless_current(icon, path, title) ⇒ Object
Links to image inside rails_metrics if the given path it’s not the current page using the given title.
120 121 122 123 124 |
# File 'app/helpers/rails_metrics_helper.rb', line 120 def link_to_image_unless_current(icon, path, title) return if current_page?(path) image = image_tag("rails_metrics/#{icon}.png", :title => title, :alt => title) link_to image, path, :title => title end |
#nagivation_links ⇒ Object
135 136 137 138 139 140 141 142 143 |
# File 'app/helpers/rails_metrics_helper.rb', line 135 def nagivation_links @navigation_links ||= begin links = [] links << link_to("All metrics", all_rails_metrics_path) links << link_to("Requests", rails_metrics_path) links << link_to("Back", :back) links.join(" | ").html_safe end end |