Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Map of maps page is broken #250

Closed
jywarren opened this issue Feb 2, 2018 · 1 comment · Fixed by #354
Closed

Map of maps page is broken #250

jywarren opened this issue Feb 2, 2018 · 1 comment · Fixed by #354

Comments

@jywarren
Copy link
Member

jywarren commented Feb 2, 2018

We show all maps on a map, at http://mapknitter.org/map/map -- but this is currently broken. The error is:

Started GET "/map/map" for 184.179.58.42 at 2018-02-02 17:48:56 +0000
Processing by MapsController#map as HTML
  Rendered maps/map.html.erb (34.8ms)
Completed 500 Internal Server Error in 36.7ms

ActionView::Template::Error (Association named 'users' was not found on Map; perhaps you misspelled it?):
    25:       (function() {
    26:       map = L.map('map').setView([0,0], 4);
    27:       L.tileLayer("https://a.tiles.mapbox.com/v3/jywarren.map-lmrwb2em/{z}/{x}/{y}.png").addTo(map);
    28:       <% @maps.each do |map| %>
    29:         <% if map.lat && map.lon %>
    30:           L.marker([<%= map.lat %>, <%= map.lon %>]).addTo(map).bindPopup("<a href='/maps/<%= map.slug %>'><%= map.name.gsub(/\n/,'') %></a><% if map.user %> by <
a href='/profile/<%= map.user.login %>'><%= map.user.login %></a><% end %>");
    31:         <% end %>
  app/views/maps/map.html.erb:28:in `_app_views_maps_map_html_erb___4321022319040003615_70037854414140'
  app/controllers/maps_controller.rb:22:in `map'

This needs a little debugging! Maybe where we're trying to joins users here:

.joins(:warpables, :users)

Also see #40

@kaustubh-nair
Copy link
Member

I'd like to take this issue, I think I can fix it!

@kaustubh-nair kaustubh-nair mentioned this issue Feb 21, 2019
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants