Class: HubController

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

Instance Attribute Summary

Attributes inherited from ApplicationController

#is_data_controller, #is_task_controller, #meta_data, #meta_description, #meta_keywords, #meta_title, #page_title, #site_name

Instance Method Summary (collapse)

Methods inherited from ApplicationController

#clear_project_and_user_variables, #digest_cookie, #digested_cookie_exists?, #disable_turbolinks, #intercept_api, #invalid_object, #is_data_controller?, #is_task_controller?, #log_user_recent_route, #notice_user, #project_matches, #record_not_found, #set_project_and_user_variables, #set_project_from_params, #token_authenticate

Methods included from ProjectsHelper

#project_link, #project_tag, #projects_list, #projects_search_form

Instance Method Details

- (Object) handle_bad_tab_order (protected)



27
28
29
30
31
32
33
34
# File 'app/controllers/hub_controller.rb', line 27

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



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

def order_tabs
  handle_bad_tab_order 
end


36
37
38
39
# File 'app/controllers/hub_controller.rb', line 36

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

- (Object) update_tab_order



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

def update_tab_order
  @sessions_current_user.update_attribute(:hub_tab_order, params[:order])
  render nothing: true
end