aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/stop_area_children_controller.rb2
-rw-r--r--app/controllers/stop_area_parents_controller.rb2
-rw-r--r--app/controllers/stop_point_areas_controller.rb20
3 files changed, 8 insertions, 16 deletions
diff --git a/app/controllers/stop_area_children_controller.rb b/app/controllers/stop_area_children_controller.rb
index 773f6e1b8..d60fcb1a6 100644
--- a/app/controllers/stop_area_children_controller.rb
+++ b/app/controllers/stop_area_children_controller.rb
@@ -11,7 +11,7 @@ class StopAreaChildrenController < ChouetteController
protected
def children_maps
- children.map { |c| c.attributes}
+ children.map {|area| area.attributes.merge( :area_type => t("area_types.label.#{area.area_type.underscore}"))}
end
def children
diff --git a/app/controllers/stop_area_parents_controller.rb b/app/controllers/stop_area_parents_controller.rb
index 06b462075..c32e5df17 100644
--- a/app/controllers/stop_area_parents_controller.rb
+++ b/app/controllers/stop_area_parents_controller.rb
@@ -9,7 +9,7 @@ class StopAreaParentsController < ChouetteController
end
def parents_maps
- parents.map { |p| p.attributes}
+ parents.map {|area| area.attributes.merge( :area_type => t("area_types.label.#{area.area_type.underscore}"))}
end
def parents
diff --git a/app/controllers/stop_point_areas_controller.rb b/app/controllers/stop_point_areas_controller.rb
index 9544d0fe6..1ece8641e 100644
--- a/app/controllers/stop_point_areas_controller.rb
+++ b/app/controllers/stop_point_areas_controller.rb
@@ -3,25 +3,17 @@ class StopPointAreasController < ChouetteController
respond_to :json, :only => :index
def index
- respond_to do |format|
- format.json { render :json => areas_maps }
- end
+ respond_to do |format|
+ format.json { render :json => areas_maps }
+ end
end
def areas_maps
- areas.collect do |area|
- { :id => area.id.to_s,
- :name => area.name,
- :country_code => area.country_code,
- :zip_code => area.zip_code || "",
- :city_name => area.city_name || "",
- :area_type => t("area_types.label.#{area.area_type.underscore}")
- }
- end
+ areas.map {|area| area.attributes.merge( :area_type => t("area_types.label.#{area.area_type.underscore}"))}
end
- def areas
- Chouette::StopPoint.area_candidates.select{ |p| p.name =~ /#{params[:q]}/i }
+ def areas
+ Chouette::StopPoint.area_candidates.select{ |p| p.name =~ /#{params[:q]}/i }
end
end