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

37 lines
780 B
Ruby
Raw Normal View History

2012-09-23 02:39:12 +00:00
class MainController < ApplicationController
include ItemsHelper
2012-09-23 02:39:12 +00:00
before_filter :require_user, only: [:invite]
2012-09-23 02:39:12 +00:00
respond_to :html, :js, :json
2012-12-14 18:31:39 +00:00
def console
end
def search
@current = current_user
@items = Array.new()
if params[:topics_by_user_id] != ""
@user = User.find(params[:topics_by_user_id])
@items = Item.visibleToUser(@current, @user)
elsif params[:topics_by_map_id] != ""
@map = Map.find(params[:topics_by_map_id])
@items = @map.items.delete_if{|item| not item.authorize_to_view(@current)}
end
respond_to do |format|
format.js { respond_with(@items) }
end
end
def invite
@user = current_user
respond_to do |format|
format.html { respond_with(@user) }
end
end
2012-09-23 02:39:12 +00:00
end