diff options
| -rw-r--r-- | app/helpers/application_helper.rb | 8 | ||||
| -rw-r--r-- | app/views/lines/show.html.slim | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index d2cdaaa20..6b35863f6 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -3,6 +3,14 @@ module ApplicationHelper include NewapplicationHelper + def array_to_html_list items + content_tag :ul do + items.each do |item| + concat content_tag :li, item + end + end + end + def page_header_title(object) # Unwrap from decorator, we want to know the object model name object = object.object if object.try(:object) diff --git a/app/views/lines/show.html.slim b/app/views/lines/show.html.slim index 4969ca3cd..d62fe30d6 100644 --- a/app/views/lines/show.html.slim +++ b/app/views/lines/show.html.slim @@ -20,7 +20,7 @@ 'Activé' => (@line.deactivated? ? t('false') : t('true')), @line.human_attribute_name(:network_id) => (@line.network.nil? ? t('lines.index.unset') : @line.network.name), @line.human_attribute_name(:company_id) => (@line.company.nil? ? t('lines.index.unset') : @line.company.name), - 'Transporteur(s) secondaire(s)' => (@line.secondary_companies.nil? ? t('lines.index.unset') : @line.secondary_companies.collect(&:name).join(', ')), + 'Transporteur(s) secondaire(s)' => (@line.secondary_companies.nil? ? t('lines.index.unset') : array_to_html_list(@line.secondary_companies.collect(&:name))), 'Nom court' => @line.number, 'Code public' => (@line.registration_number ? @line.registration_number : '-'), @line.human_attribute_name(:transport_mode) => (@line.transport_mode.present? ? t("enumerize.transport_mode.#{@line.transport_mode}") : '-'), |
