catburston / townbikes

Ironhack Web Development Bootcamp final project. Townbikes is a platform to rent your unused bicycle to travellers or find the best bicycle for your needs when you are travelling.
1 stars 1 forks source link

First login after signup does not work #26

Closed mediafinger closed 10 years ago

mediafinger commented 10 years ago
NoMethodError in Locations#index
Showing /Users/andy/www/townbikes/app/views/locations/_multiple_locations.html.erb where line #26 raised:

undefined method `+' for nil:NilClass
Extracted source (around line #26):

   <script>
     var multiHandler = Gmaps.build('Google');
     multiHandler.buildMap({ internal: {id: 'multi_markers'}}, function(){
       var markers = multiHandler.addMarkers(<%= raw Location.markers(locations) %>);
       multiHandler.bounds.extendWith(markers);
       multiHandler.fitMapToBounds();
     });

Trace of template inclusion: app/views/locations/index.html.erb

Rails.root: /Users/andy/www/townbikes

Application Trace | Framework Trace | Full Trace
app/models/location.rb:30:in `block in markers'
app/models/location.rb:26:in `markers'
app/views/locations/_multiple_locations.html.erb:26:in `_app_views_locations__multiple_locations_html_erb__338852820551299211_70201323651420'
app/views/locations/index.html.erb:4:in `_app_views_locations_index_html_erb___86219247214046846_70201323719860'
Request

Parameters:

{"ids"=>["1",
 "2",
 "3"]}
catburston commented 10 years ago

Fixed now...