diff options
| author | Luc Donnet | 2012-02-15 12:10:49 +0100 |
|---|---|---|
| committer | Luc Donnet | 2012-02-15 12:10:49 +0100 |
| commit | fa26c241d19bea9b15ada7392a4a8de682794c09 (patch) | |
| tree | 353a5a74b50eb3b550ccd0cd182e767ec361a268 /app/helpers | |
| parent | d2121da8941e8e4154fe6970badcd44278e86074 (diff) | |
| download | chouette-core-fa26c241d19bea9b15ada7392a4a8de682794c09.tar.bz2 | |
Add line to the model
Diffstat (limited to 'app/helpers')
| -rw-r--r-- | app/helpers/application_helper.rb | 16 | ||||
| -rw-r--r-- | app/helpers/lines_helper.rb | 6 |
2 files changed, 16 insertions, 6 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index a16d32d46..ef354cc30 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3,5 +3,21 @@ module ApplicationHelper def chouette_line_path(line) line_path(line) end + + def chouette_network_path(line) + network_path(line) + end + + def chouette_company_path(line) + company_path(line) + end + + def link_to_order(name, column) + css_class = (column == sort_column) ? "current #{sort_direction}" : nil + Rails.logger.debug sort_direction.inspect + direction = (column == sort_column && sort_direction == "asc") ? "desc" : "asc" + Rails.logger.debug direction.inspect + link_to name, { :sort => column, :direction => direction}, {:class => css_class} + end end diff --git a/app/helpers/lines_helper.rb b/app/helpers/lines_helper.rb index 45bd8c6c3..a03868a0a 100644 --- a/app/helpers/lines_helper.rb +++ b/app/helpers/lines_helper.rb @@ -1,8 +1,2 @@ module LinesHelper - def order(column) - title ||= Chouette::Line.human_attribute_name(column).titleize - css_class = (column == sort_column) ? "current #{sort_direction}" : nil - direction = (column == sort_column && sort_direction == "asc") ? "desc" : "asc" - link_to title, { :sort => column, :direction => direction}, {:class => css_class} - end end |
