From 1d35d77ff3801c6e1ac56d10f1898ad6527a1048 Mon Sep 17 00:00:00 2001 From: Xinhui Date: Thu, 9 Nov 2017 11:24:54 +0100 Subject: Remove route_sections controllers, views, helper --- app/controllers/route_sections_controller.rb | 70 ------------- .../route_sections_selectors_controller.rb | 47 --------- app/helpers/application_helper.rb | 2 - app/helpers/route_section_selectors_helper.rb | 23 ---- .../design/route_section_selector_style_map.rb | 73 ------------- app/maps/design/route_section_style_map.rb | 66 ------------ app/maps/route_section_map.rb | 66 ------------ app/maps/route_section_selector_map.rb | 116 --------------------- app/views/help/route_sections.textile | 92 ---------------- app/views/help/toc.textile | 1 - app/views/journey_patterns/show.html.slim | 6 -- app/views/route_sections/_form.html.slim | 21 ---- app/views/route_sections/edit.html.slim | 6 -- app/views/route_sections/index.html.slim | 49 --------- app/views/route_sections/new.html.slim | 4 - app/views/route_sections/show.html.slim | 27 ----- app/views/route_sections/show.kml.slim | 6 -- .../route_sections_selectors/_selection.js.slim | 21 ---- app/views/route_sections_selectors/edit.html.slim | 34 ------ app/views/shared/_header.html.slim | 5 - 20 files changed, 735 deletions(-) delete mode 100644 app/controllers/route_sections_controller.rb delete mode 100644 app/controllers/route_sections_selectors_controller.rb delete mode 100644 app/helpers/route_section_selectors_helper.rb delete mode 100644 app/maps/design/route_section_selector_style_map.rb delete mode 100644 app/maps/design/route_section_style_map.rb delete mode 100644 app/maps/route_section_map.rb delete mode 100644 app/maps/route_section_selector_map.rb delete mode 100644 app/views/help/route_sections.textile delete mode 100644 app/views/route_sections/_form.html.slim delete mode 100644 app/views/route_sections/edit.html.slim delete mode 100644 app/views/route_sections/index.html.slim delete mode 100644 app/views/route_sections/new.html.slim delete mode 100644 app/views/route_sections/show.html.slim delete mode 100644 app/views/route_sections/show.kml.slim delete mode 100644 app/views/route_sections_selectors/_selection.js.slim delete mode 100644 app/views/route_sections_selectors/edit.html.slim diff --git a/app/controllers/route_sections_controller.rb b/app/controllers/route_sections_controller.rb deleted file mode 100644 index 03d6cf176..000000000 --- a/app/controllers/route_sections_controller.rb +++ /dev/null @@ -1,70 +0,0 @@ -class RouteSectionsController < ChouetteController - - defaults :resource_class => Chouette::RouteSection - - respond_to :html - respond_to :kml, :only => :show - - belongs_to :referential - - before_action :save_return_to_path, only: [:edit, :create_to_edit] - - helper_method :search - - def new - @stop_areas = referential.stop_areas.with_geometry.order :name - new! - end - - def show - @map = RouteSectionMap.new(resource).with_helpers(self) - show! - end - - def edit - @map = RouteSectionMap.new(resource, true).with_helpers(self) - edit! - end - - def update - update! { session.delete(:return_to) } - end - - def create - create! { session.delete(:return_to) } - end - - def create_to_edit - route_section = Chouette::RouteSection.create(route_section_params) - if route_section.id - redirect_to edit_referential_route_section_path(referential, route_section) - else - flash[:alert] = I18n.t('route_sections.unable_to_contact_server') - redirect_to :back - end - end - - protected - - def save_return_to_path - session[:return_to] = params[:return_to] if params[:return_to] - end - - def collection - # if q = params[:q] - # @route_sections ||= Chouette::RouteSection.joins(:departure, :arrival).where(departure: {name: "#{q}"}).or.where(arrival: {name: "#{q}"}) - # end - @route_sections ||= search.collection.includes(:departure, :arrival).paginate page: params[:page] - end - - def search - @search ||= RouteSectionSearch.new(params[:route_section_search]) - end - - private - - def route_section_params - params.require(:route_section).permit(:departure_id, :arrival_id, :editable_geometry, :no_processing) - end - -end diff --git a/app/controllers/route_sections_selectors_controller.rb b/app/controllers/route_sections_selectors_controller.rb deleted file mode 100644 index b5b5ebd48..000000000 --- a/app/controllers/route_sections_selectors_controller.rb +++ /dev/null @@ -1,47 +0,0 @@ -class RouteSectionsSelectorsController < ChouetteController - - # singleton option makes association_chain crazy - #defaults singleton: true - - respond_to :html, only: [ :edit, :update ] - respond_to :js, only: :section - - belongs_to :referential do - belongs_to :line, :parent_class => Chouette::Line do - belongs_to :route, :parent_class => Chouette::Route do - belongs_to :journey_pattern, parent_class: Chouette::JourneyPattern - end - end - end - - def edit - @map = RouteSectionSelectorMap.new(resource).with_helpers(self) - end - - def update - update! - parent.control_route_sections - end - - def selection - parent - - @route_section = referential.route_sections.find params[:route_section_id].to_i - render partial: 'selection', format: 'js' - end - - private - - def resource - @route_sections_selector ||= RouteSectionsSelector.new parent - end - - def build_resource - @route_sections_selector ||= RouteSectionsSelector.new parent, *resource_params - end - - def route_section_selector_params - params.require(:route_section_selector).permit() - end - -end diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 5edb8c3bf..9f2e2765f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -73,8 +73,6 @@ module ApplicationHelper "time_tables" when path.include?("/timebands") "timebands" - when path.include?("/route_sections") - "route_sections" when path.include?("/rule_parameter_set") "parametersets" when path.include?("/import_tasks") diff --git a/app/helpers/route_section_selectors_helper.rb b/app/helpers/route_section_selectors_helper.rb deleted file mode 100644 index 1be30066b..000000000 --- a/app/helpers/route_section_selectors_helper.rb +++ /dev/null @@ -1,23 +0,0 @@ -module RouteSectionSelectorsHelper - - def link_to_edit_route_section(route_section) - classes = [ 'edit-route-section' ] - link ='#' - - if route_section.present? - return_to = edit_referential_line_route_journey_pattern_route_sections_selector_path(@referential, @line, @route, @journey_pattern) - link = edit_referential_route_section_path(@referential, route_section, return_to: return_to) - else - classes << 'disabled' - end - - link_to "Edit", link, class: classes, title: t('route_sections_selectors.edit.route_section.edit') - end - - def link_to_create_route_section(departure, arrival) - return_to = edit_referential_line_route_journey_pattern_route_sections_selector_path(@referential, @line, @route, @journey_pattern) - link_to t('route_sections_selectors.edit.route_section.new'), - create_to_edit_referential_route_sections_path(@referential, route_section: {departure_id:departure.id, arrival_id: arrival.id}, return_to: return_to) - end - -end diff --git a/app/maps/design/route_section_selector_style_map.rb b/app/maps/design/route_section_selector_style_map.rb deleted file mode 100644 index 12f192ec8..000000000 --- a/app/maps/design/route_section_selector_style_map.rb +++ /dev/null @@ -1,73 +0,0 @@ -class Design::RouteSectionSelectorStyleMap < Design::GenericStyleMap - attr_accessor :style - - def initialize(helpers, options = {}) - @helpers = helpers - @style = options[:style].present? ? default_style.merge(options[:style]) : default_style - end - - def select_style - { - fillColor: "blue", - graphicName: "square", - rotation: 90, - strokeColor: "#00dd00", - pointRadius: 15, - graphicZIndex: 100 - } - end - - def highlight_style - { - fillColor: "orange", - graphicName: "square", - rotation: 90, - strokeColor: "#dd0000", - pointRadius: 15, - graphicZIndex: 200 - } - end - - def default_style - { - label: "${label}", - fontColor: "black", - fontSize: "11px", - fontWeight: "bold", - labelAlign: "ct", - labelXOffset: 0, - labelYOffset: -15, - strokeColor: "#0000dd", - strokeOpacity: 1, - strokeWidth: 3, - strokeLineCap: "round", - strokeDashstyle: "solid", - externalGraphic: @helpers.assets_path_patch( "map/${positionType}.png"), - graphicWidth: 12, - graphicHeight: 12, - graphicOpacity: 1, - graphicXOffset: -6, - graphicYOffset: -6, - display: true, - fillColor: "red", - graphicName: "square", - rotation: 90, - graphicZIndex: 10 - } - end - - def context - { - label: :" function(feature) {if(feature.layer.map.getZoom() > 13) { return feature.attributes.name;} else {return '';}} ", - positionType: :" function(feature) { if (feature.attributes.iconCode != undefined) {return feature.attributes.iconCode;} else { return '';} } " - } - end - - def style_map - OpenLayers::StyleMap.new( - default: OpenLayers::Style.new(style, { context: context}), - select: OpenLayers::Style.new(style.merge(select_style), { context: context }), - highlight: OpenLayers::Style.new(style.merge( highlight_style), { context: context })) - end - -end diff --git a/app/maps/design/route_section_style_map.rb b/app/maps/design/route_section_style_map.rb deleted file mode 100644 index dbd292412..000000000 --- a/app/maps/design/route_section_style_map.rb +++ /dev/null @@ -1,66 +0,0 @@ -class Design::RouteSectionStyleMap < Design::GenericStyleMap - attr_accessor :style - - def initialize(helpers, options = {}) - @helpers= helpers - @style = options[:style].present? ? default_style.merge(options[:style]) : default_style - end - - def select_style - { - fillColor:"blue", - graphicName:"circle", - rotation:90, - :strokeColor => "red", - pointerEvents: "visiblePainted" - } - end - - def highlight_style - { - fillColor:"lightblue", - graphicName:"circle", - rotation:90, - :strokeColor => "#dd0000" - } - end - - def default_style - - { - :fontColor => "black", - :fontSize => "11px", - :fontWeight => "bold", - :labelAlign => "cm", - :labelXOffset => 0, - :labelYOffset => -15, - :strokeColor => "green", - :strokeOpacity => 1, - :strokeWidth => 4, - :strokeLineCap => "round", - :strokeLineJoin => "round", - :strokeDashstyle => "solid", - :lineCap => "round", - :lineJoin => "round", - :dashstyle => "solid", - :graphicWidth => 12, - :graphicHeight => 12, - :graphicOpacity => 1, - :graphicXOffset => -6, - :graphicYOffset => -6, - :display => true, - fillOpacity: 0.8, - fillColor: "#ffffff", - graphicName: "circle", - pointRadius: 7, - pointerEvents: "visiblePainted", - rotation: 90 - } - - end - - def style_map - OpenLayers::StyleMap.new(:default => OpenLayers::Style.new(style), :select => OpenLayers::Style.new(style.merge( select_style)), :highlight => OpenLayers::Style.new(style.merge( highlight_style))) - end - -end diff --git a/app/maps/route_section_map.rb b/app/maps/route_section_map.rb deleted file mode 100644 index de4d5e746..000000000 --- a/app/maps/route_section_map.rb +++ /dev/null @@ -1,66 +0,0 @@ -class RouteSectionMap < ApplicationMap - - attr_reader :route_section - - attr_accessor :editable - alias_method :editable?, :editable - - def initialize(route_section, editable = false) - @route_section = route_section - @editable = editable - end - - def customize_map(map, page) - # layers order seems to matter for ModifyFeature control - route_section.stop_areas.each do |stop_area| - layer = "stop_area_#{stop_area.id}".to_sym - page.assign layer.to_s, kml_layer(stop_area, :styleMap => Design::StopAreasStyleMap.new(helpers).style_map) - page << map.add_layer(layer) - page << map.add_control( hover_control_display_name(layer) ) - end - - geometry_options = {}.tap do |options| - options[:mode] = :editable if editable? - end - geometry_uneditable_kml_layer = kml_layer(route_section, :styleMap => Design::RouteSectionSelectorStyleMap.new(helpers).style_map) - page << map.add_layer(geometry_uneditable_kml_layer) - - if route_section.input_geometry - geometry_editable_layer = kml_layer(route_section, geometry_options, {}) # , :styleMap => Design::LineStyleMap.new(style: nil).style_map) - else - points = route_section.stop_areas.map{|point| OpenLayers::Geometry::Point.new(point.longitude, point.latitude).transform("EPSG:4326", "EPSG:900913")} - geometry_editable_layer = OpenLayers::Layer::Vector.new("user_geometry", {:projection => projection("EPSG:4326"), :styleMap => Design::RouteSectionStyleMap.new(helpers).style_map}) - geometry_editable_features = OpenLayers::Feature::Vector.new(OpenLayers::Geometry::LineString.new(points)) - page.assign :geometry_editable_features, geometry_editable_features - end - - if editable - page.assign :user_geometry, geometry_editable_layer - - page << "user_geometry.addFeatures([geometry_editable_features])" if geometry_editable_features - - page << map.add_layer(:user_geometry) - - page.assign :modify_feature, OpenLayers::Control::ModifyFeature.new(:user_geometry, autoActivate: true) - page << map.add_control( :modify_feature ) - else - page << map.add_layer(geometry_editable_layer) - end - - page << map.zoom_to_extent(bounds.to_google.to_openlayers) if bounds - end - - def bounds - @bounds ||= - if route_section.geometry.present? - route_section.geometry.bounds - elsif route_section.stop_areas.present? - GeoRuby::SimpleFeatures::Point.bounds route_section.stop_areas.collect(&:geometry) - end - end - - def ready? - bounds.present? - end - -end diff --git a/app/maps/route_section_selector_map.rb b/app/maps/route_section_selector_map.rb deleted file mode 100644 index 7287c4d8a..000000000 --- a/app/maps/route_section_selector_map.rb +++ /dev/null @@ -1,116 +0,0 @@ -class RouteSectionSelectorMap < ApplicationMap - - attr_reader :route_section_selector, :style - - def initialize(route_section_selector, style = nil) - @route_section_selector = route_section_selector - @style = nil - end - - def customize_map(map, page) - layer = kml_layer([route_section_selector.itinerary.referential, route_section_selector.itinerary.route.line, route_section_selector.itinerary.route, route_section_selector.itinerary], - { rendererOptions: { zIndexing: true }, styleMap: Design::JourneyPatternStyleMap.new(helpers).style_map }) - page.assign 'journeyPatternLayer', layer - - page << map.add_layer(:journeyPatternLayer) - page << map.add_control(hover_control_display_name(:journeyPatternLayer)) - - route_section_geometry = OpenLayers::Layer::Vector.new('Route Section Geometry', - { projection: projection('EPSG:900913'), - rendererOptions: { zIndexing: true }, - styleMap: Design::RouteSectionSelectorStyleMap.new(helpers).style_map}) - - route_section_layer_points = [] - route_section_selector.sections.reject{|s| s.candidates.length==0}.each do |section| - section.candidates.each do |candidate| - geometry = candidate.processed_geometry - route_section_layer_points << ["#{candidate.id}"] + clean_route_section_line(geometry) - end - end - - page.assign :route_section_layer_points, route_section_layer_points - page << < :delete, :data => {:confirm => t('journey_patterns.actions.destroy_confirm')}, class: 'remove' - li - = link_to edit_referential_line_route_journey_pattern_route_sections_selector_path(@referential, @line, @route, @journey_pattern), class: "edit#{' control-shape' if @journey_pattern.control?}" do - = t('journey_patterns.actions.edit_route_sections') - - if @journey_pattern.control? - i.fa.fa-exclamation-triangle - li = link_to t('journey_patterns.journey_pattern.vehicle_journey_at_stops'), referential_line_route_vehicle_journeys_path(@referential, @line, @route, :q => {:journey_pattern_id_eq => @journey_pattern.id, :journey_pattern_object_id => @journey_pattern.objectid}), class: 'clock' diff --git a/app/views/route_sections/_form.html.slim b/app/views/route_sections/_form.html.slim deleted file mode 100644 index 51e4fdcf6..000000000 --- a/app/views/route_sections/_form.html.slim +++ /dev/null @@ -1,21 +0,0 @@ -= semantic_form_for [@referential, @route_section] do |form| - = form.inputs do - - if @route_section.new_record? - = form.input :departure, as: :select, collection: @stop_areas, include_blank: false - = form.input :arrival, as: :select, collection: @stop_areas, include_blank: false - - else - li.input.optional - label.label = @route_section.human_attribute_name('departure') - = @route_section.departure.name - - li.input.optional - label.label = @route_section.human_attribute_name('arrival') - = @route_section.arrival.name - - = form.input :editable_geometry, as: :hidden - - = form.input :no_processing, label: t('.no_processing'), as: :select, collection: { t('.standard_processor') => false, t('.no_processor') => true }, include_blank: false - - = form.actions do - = form.action :submit, as: :button, label: t('.submit') - = form.action :cancel, as: :link \ No newline at end of file diff --git a/app/views/route_sections/edit.html.slim b/app/views/route_sections/edit.html.slim deleted file mode 100644 index 7c95def73..000000000 --- a/app/views/route_sections/edit.html.slim +++ /dev/null @@ -1,6 +0,0 @@ -- breadcrumb :referential_route_section, @referential, @route_section - -= title_tag t('route_sections.edit.title') - -= @map.to_html if @map -== render 'form' diff --git a/app/views/route_sections/index.html.slim b/app/views/route_sections/index.html.slim deleted file mode 100644 index c459af73c..000000000 --- a/app/views/route_sections/index.html.slim +++ /dev/null @@ -1,49 +0,0 @@ -- breadcrumb :referential_route_sections, @referential -= title_tag t('.title') - -= form_for search, url: referential_route_sections_path(@referential), method: :get, class: 'form-inline' do |form| - .panel.panel-default - .panel-heading - .col-md-6 - = form.text_field :departure_name, class: 'form-control', placeholder: Chouette::RouteSection.human_attribute_name(:departure) - - .input-group.col-md-6 - = form.text_field :arrival_name, class: 'form-control', placeholder: Chouette::RouteSection.human_attribute_name(:arrival) - - .input-group-btn - button.btn.btn-default type="submit" - i.fa.fa-search - - .panel-body - .col-md-4 - = form.select :line_id, @referential.lines.order(:name).pluck(:name, :id), { include_blank: t('.all_lines')}, class: 'form-control' - -table.table.table-hover.table-striped - thead - tr - th = Chouette::RouteSection.human_attribute_name :departure - th = Chouette::RouteSection.human_attribute_name :arrival - th.distance = Chouette::RouteSection.human_attribute_name :distance - th.points = Chouette::RouteSection.human_attribute_name :points - th.points = Chouette::RouteSection.human_attribute_name :quantity - th.actions - - tbody - - @route_sections.each do |route_section| - tr - td - = route_section.departure.name - = link_to content_tag(:i, "", class: "fa fa-external-link"), referential_stop_area_path(@referential, route_section.departure) - td - = route_section.arrival.name - = link_to content_tag(:i, "", class: "fa fa-external-link"), referential_stop_area_path(@referential, route_section.arrival) - td.distance = route_section.distance.to_i if route_section.distance - td.points = route_section.via_count if route_section.via_count > 0 - td.journey_patterns = route_section.journey_pattern_sections.count(:journey_pattern_id, distinct: true) - td.actions - = link_to t('.actions.show'), referential_route_section_path(@referential, route_section), class: 'view' - = link_to t('.actions.edit'), edit_referential_route_section_path(@referential, route_section), class: 'edit' - = link_to t('.actions.destroy'), referential_route_section_path(@referential, route_section), method: :delete, data: { confirm: t('route_sections.actions.destroy_confirm') }, class: 'remove' - -.pagination - = will_paginate @route_sections, :container => false, renderer: RemoteBootstrapPaginationLinkRenderer diff --git a/app/views/route_sections/new.html.slim b/app/views/route_sections/new.html.slim deleted file mode 100644 index 79f4cda2b..000000000 --- a/app/views/route_sections/new.html.slim +++ /dev/null @@ -1,4 +0,0 @@ -- breadcrumb :referential_route_sections, @referential -= title_tag t('route_sections.new.title') - -== render 'form' diff --git a/app/views/route_sections/show.html.slim b/app/views/route_sections/show.html.slim deleted file mode 100644 index afd0ed0d6..000000000 --- a/app/views/route_sections/show.html.slim +++ /dev/null @@ -1,27 +0,0 @@ -- breadcrumb :referential_route_section, @referential, @route_section -= title_tag t('.title') - -.route_section - = @map.to_html - - .summary - p - label = "#{@route_section.human_attribute_name('departure')} : " - = @route_section.departure.name - - p - label = "#{@route_section.human_attribute_name('arrival')} : " - = @route_section.arrival.name - - p - label = "#{@route_section.human_attribute_name('distance')} : " - = "#{@route_section.distance.round}m" if @route_section.distance - -- content_for :sidebar do - ul.actions - li - = link_to t('route_sections.actions.edit'), edit_referential_route_section_path(@referential, @route_section), class: 'edit' - li - = link_to t('route_sections.actions.destroy'), referential_route_section_path(@referential, @route_section), :method => :delete, :data => {:confirm => t('route_sections.actions.destroy_confirm')}, class: 'remove' - - = creation_tag(@route_section) diff --git a/app/views/route_sections/show.kml.slim b/app/views/route_sections/show.kml.slim deleted file mode 100644 index 9dbb4957b..000000000 --- a/app/views/route_sections/show.kml.slim +++ /dev/null @@ -1,6 +0,0 @@ -doctype XML - -kml xmlns="http://www.opengis.net/kml/2.2" - document - placemark id="route-section-#{@route_section.id}" - = @route_section.geometry(params[:mode]).kml_representation.html_safe \ No newline at end of file diff --git a/app/views/route_sections_selectors/_selection.js.slim b/app/views/route_sections_selectors/_selection.js.slim deleted file mode 100644 index 6b5489171..000000000 --- a/app/views/route_sections_selectors/_selection.js.slim +++ /dev/null @@ -1,21 +0,0 @@ -div - span.departure - label = "#{@route_section.human_attribute_name('departure')} : " - = link_to @route_section.departure.name, referential_stop_area_path(@referential, @route_section.departure) - - span.arrival - label = "#{@route_section.human_attribute_name('arrival')} : " - = link_to @route_section.arrival.name, referential_stop_area_path(@referential, @route_section.arrival) - - span.distance - label = "#{@route_section.human_attribute_name('distance')} : " - = "#{@route_section.distance.to_i} m" if @route_section.distance > 0 - - - if @route_section.via_count > 0 - span.via_count - label = "#{@route_section.human_attribute_name('via_count')} : " - = @route_section.via_count if @route_section.via_count > 0 - - span.actions - = link_to_edit_route_section @route_section - = link_to_create_route_section @route_section.departure, @route_section.arrival \ No newline at end of file diff --git a/app/views/route_sections_selectors/edit.html.slim b/app/views/route_sections_selectors/edit.html.slim deleted file mode 100644 index 9dcee8af3..000000000 --- a/app/views/route_sections_selectors/edit.html.slim +++ /dev/null @@ -1,34 +0,0 @@ -= title_tag t('.title', journey_pattern: journey_name(@journey_pattern)) - -.large-map - = @map.to_html(no_fullscreen: true) - -= semantic_form_for resource, url: referential_line_route_journey_pattern_route_sections_selector_path(@referential, @line, @route, @journey_pattern), method: :put do |form| - h3 = t('.selection.title') - - #map-selection style="display: none;" - div - - #empty-map-selection - = t('.no_selection') - - h3 = t('.form.title') - - table.table.table-hover.table-striped - tbody - = form.fields_for :sections do |section_form| - tr - td = link_to section_form.object.departure.name, referential_stop_area_path(@referential, section_form.object.departure) - td.route_section - - if section_form.object.candidates.present? - = section_form.input :route_section_id, as: :select, label: false, collection: section_form.object.candidates, include_blank: t('.no_selection') - - else - = t('.no_candidate') - - td.action - = link_to_edit_route_section section_form.object.route_section - = link_to_create_route_section section_form.object.departure, section_form.object.arrival - - = form.actions do - = form.action :submit, as: :button, label: t('.submit') - = form.action :cancel, as: :link, url: referential_line_route_journey_pattern_path(@referential, @line, @route, @journey_pattern) \ No newline at end of file diff --git a/app/views/shared/_header.html.slim b/app/views/shared/_header.html.slim index 33aee09a4..afe802b49 100644 --- a/app/views/shared/_header.html.slim +++ b/app/views/shared/_header.html.slim @@ -81,11 +81,6 @@ nav.navbar.navbar-default.navbar-fixed-top role="navigation" span.badge.pull-right = @referential.time_tables.size = Referential.human_attribute_name("time_tables") - li - = link_to referential_route_sections_path(@referential) do - span.badge.pull-right = @referential.route_sections.size - = Referential.human_attribute_name("route_sections") - li = link_to referential_timebands_path(@referential) do span.badge.pull-right = @referential.timebands.size -- cgit v1.2.3