Class: HubController

Inherits:
ApplicationController show all
Defined in:
app/controllers/hub_controller.rb

Instance Method Summary (collapse)

Methods included from RequestType

#json_request?

Methods included from LogRecent

#log_user_recent_route

Methods included from Cookies

#digest_cookie, #digested_cookie_exists?

Methods included from Whitelist

#whitelist_constantize

Methods included from ProjectsHelper

#invalid_object, #project_link, #project_matches, #project_tag, #projects_list, #projects_search_form

Methods included from Api::Intercept

#intercept_api

Instance Method Details

- (Object) handle_bad_tab_order (protected)



31
32
33
34
35
36
37
38
# File 'app/controllers/hub_controller.rb', line 31

def handle_bad_tab_order
  # This is preventative only, it should never happen in real data, and may only occur when 
  # we reset tab performance.
  if @sessions_current_user.hub_tab_order.empty?
    @sessions_current_user.update_attribute(:hub_tab_order, DEFAULT_HUB_TAB_ORDER)
  end
  true
end

- (Object) index

GET /hub



6
7
8
9
10
11
12
13
14
# File 'app/controllers/hub_controller.rb', line 6

def index
  handle_bad_tab_order
  respond_to do |format|
    format.html {}
    format.js {
      render partial: 'navigation_index' # layout: nil
    }
  end 
end

- (Object) order_tabs



20
21
22
# File 'app/controllers/hub_controller.rb', line 20

def order_tabs
  handle_bad_tab_order
end


40
41
42
43
# File 'app/controllers/hub_controller.rb', line 40

def set_links_to_render
  @links_to_render = params[:list]
  @links_to_render ||= @sessions_current_user.hub_tab_order.first
end

- (Object) tasks



16
17
18
# File 'app/controllers/hub_controller.rb', line 16

def tasks
  @tasks = UserTasks.hub_tasks(params[:category])
end

- (Object) update_tab_order



24
25
26
27
# File 'app/controllers/hub_controller.rb', line 24

def update_tab_order
  @sessions_current_user.update_attribute(:hub_tab_order, params[:order])
  head :ok
end