metamaps--metamaps/app/controllers/main_controller.rb

32 lines
520 B
Ruby
Raw Normal View History

2012-09-22 22:39:12 -04:00
class MainController < ApplicationController
include ItemsHelper
2012-09-22 22:39:12 -04:00
respond_to :html, :js, :json
def home
@current_user = current_user
2012-10-19 00:06:16 -04:00
@item = Item.all.first
2012-09-22 22:39:12 -04:00
if @item
@alljson = @item.all_as_json.html_safe
end
2012-10-19 00:06:16 -04:00
respond_to do |format|
format.html { respond_with(@item) }
format.json { respond_with(@alljson) }
end
2012-09-22 22:39:12 -04:00
end
def allmaps
@current_user = current_user
2012-10-17 20:51:54 -04:00
@maps = Map.all
respond_to do |format|
format.html { respond_with(@maps) }
end
end
2012-09-22 22:39:12 -04:00
end