2012-09-23 02:39:12 +00:00
|
|
|
class MainController < ApplicationController
|
2012-10-26 10:04:52 +00:00
|
|
|
include ItemsHelper
|
2012-09-23 02:39:12 +00:00
|
|
|
|
|
|
|
respond_to :html, :js, :json
|
|
|
|
|
|
|
|
def home
|
|
|
|
@current_user = current_user
|
|
|
|
|
2012-10-19 04:06:16 +00:00
|
|
|
@item = Item.all.first
|
2012-09-23 02:39:12 +00:00
|
|
|
|
2012-10-26 10:04:52 +00:00
|
|
|
if @item
|
|
|
|
@alljson = @item.all_as_json.html_safe
|
|
|
|
end
|
2012-10-19 04:06:16 +00:00
|
|
|
|
|
|
|
respond_to do |format|
|
|
|
|
format.html { respond_with(@item) }
|
|
|
|
format.json { respond_with(@alljson) }
|
|
|
|
end
|
2012-09-23 02:39:12 +00:00
|
|
|
end
|
2012-10-08 05:45:44 +00:00
|
|
|
|
2012-10-26 10:04:52 +00:00
|
|
|
def allmaps
|
|
|
|
@current_user = current_user
|
2012-10-18 00:51:54 +00:00
|
|
|
|
2012-10-26 10:04:52 +00:00
|
|
|
@maps = Map.all
|
2012-10-08 05:45:44 +00:00
|
|
|
|
2012-10-26 10:04:52 +00:00
|
|
|
respond_to do |format|
|
|
|
|
format.html { respond_with(@maps) }
|
2012-10-19 21:26:46 +00:00
|
|
|
end
|
2012-10-08 05:45:44 +00:00
|
|
|
end
|
2012-09-23 02:39:12 +00:00
|
|
|
|
|
|
|
end
|