made feedback and metamaps manual display conditional instead of hard coded so there's not errors on a blank database
This commit is contained in:
parent
4787ca23c5
commit
77420bcb09
5 changed files with 16 additions and 6 deletions
|
@ -11,7 +11,7 @@ class MainController < ApplicationController
|
||||||
@maps = Map.visibleToUser(@current, nil)
|
@maps = Map.visibleToUser(@current, nil)
|
||||||
@map = @maps.sample
|
@map = @maps.sample
|
||||||
|
|
||||||
@mapjson = @map.self_as_json(@current).html_safe
|
@mapjson = @map.self_as_json(@current).html_safe if @map
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html { respond_with(@map, @user) }
|
format.html { respond_with(@map, @user) }
|
||||||
|
|
|
@ -23,9 +23,14 @@ class SessionsController < ApplicationController
|
||||||
@user = User.new
|
@user = User.new
|
||||||
|
|
||||||
@connor = User.find(555629996)
|
@connor = User.find(555629996)
|
||||||
@map = Map.find(5)
|
@map = Map.find(:first, 5)
|
||||||
|
|
||||||
respond_with(@user, @session, location: user_map_url(@connor,@map)) do |format|
|
if @map
|
||||||
|
respond_with(@user, @session, location: user_map_url(@connor,@map)) do |format|
|
||||||
|
end
|
||||||
|
else
|
||||||
|
respond_with(@user, @session, location: root_url) do |format|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -40,9 +40,14 @@ class UsersController < ApplicationController
|
||||||
|
|
||||||
# direct them straight to the metamaps manual map.
|
# direct them straight to the metamaps manual map.
|
||||||
@connor = User.find(555629996)
|
@connor = User.find(555629996)
|
||||||
@map = Map.find(5)
|
@map = Map.find(:first, 5)
|
||||||
|
|
||||||
respond_with(@user, location: user_map_url(@connor,@map)) do |format|
|
if @map
|
||||||
|
respond_with(@user, location: user_map_url(@connor,@map)) do |format|
|
||||||
|
end
|
||||||
|
else
|
||||||
|
respond_with(@user, location: root_url) do |format|
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
<% unless Map.find(:all, 7).empty? %>
|
<% unless Map.find(:first, 7).nil? %>
|
||||||
<div class="feedback"><%= link_to "Feedback", user_map_path(User.find(555629996), Map.find(7)) %></div>
|
<div class="feedback"><%= link_to "Feedback", user_map_path(User.find(555629996), Map.find(7)) %></div>
|
||||||
<% end %>
|
<% end %>
|
||||||
<div class="legend">
|
<div class="legend">
|
||||||
|
|
Binary file not shown.
Loading…
Reference in a new issue