diff options
| author | jpl | 2017-02-06 16:09:10 +0100 | 
|---|---|---|
| committer | jpl | 2017-02-06 16:09:10 +0100 | 
| commit | 3567bbf39d65d55c3e49b647bac4bf4b5cbb6fc3 (patch) | |
| tree | 103d25fbc4b4821458892f0c73645efa5f66d04f | |
| parent | aee4fc870f4f7b974eb40a132573aa73c18042df (diff) | |
| download | chouette-core-3567bbf39d65d55c3e49b647bac4bf4b5cbb6fc3.tar.bz2 | |
Refs #2535: fixing link generator on table builder td
| -rw-r--r-- | app/helpers/newapplication_helper.rb | 18 | 
1 files changed, 16 insertions, 2 deletions
| diff --git a/app/helpers/newapplication_helper.rb b/app/helpers/newapplication_helper.rb index 010ff71f6..a9bd11d11 100644 --- a/app/helpers/newapplication_helper.rb +++ b/app/helpers/newapplication_helper.rb @@ -27,8 +27,22 @@ module NewapplicationHelper                else                  item.try(attribute)                end -            if attribute == "name" -              bcont << content_tag(:td, link_to(value, item), title: 'Voir') +            if attribute == 'name' +              lnk = [] +              unless item.class.to_s == 'Calendar' or item.class.to_s == 'Referential' +                if current_referential +                  lnk << current_referential +                  lnk << item.line if item.respond_to? :line +                elsif item.respond_to? :referential +                  lnk << item.referential +                elsif item.respond_to? :line_referential +                  lnk << item.line_referential +                end +              end + +              lnk << item + +              bcont << content_tag(:td, link_to(value, lnk), title: 'Voir')              else                bcont << content_tag(:td, value)              end | 
