Class: Caboose::StationController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#add_ga_event, #admin_add, #admin_bulk_add, #admin_bulk_delete, #admin_bulk_update, #admin_delete, #admin_edit, #admin_index, #admin_json, #admin_json_single, #admin_update, #before_action, #before_before_action, #hashify_query_string, #init_cart, #logged_in?, #logged_in_user, #login_user, #logout_user, #parse_url_params, #reject_param, #under_construction_or_forwarding_domain?, #user_is_allowed, #user_is_allowed_to, #validate_cookie, #validate_token, #var, #verify_logged_in

Instance Method Details

#indexObject


7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/caboose/station_controller.rb', line 7

def index
  @user = logged_in_user
  page_id = params['page_id'].nil? ? Page.index_page(@site.id).id : params['page_id']
  @page = Page.find(page_id)
  @tab = params['tab']
  
  if @user.nil? || @user.id == Caboose::User.logged_out_user_id(@site.id)
    redirect_to "/login"
  end
end

#index_adminObject


24
25
26
27
28
29
# File 'app/controllers/caboose/station_controller.rb', line 24

def index_admin
  session[:caboose_station_state]       = params[:state]
  session[:caboose_station_open_tabs]   = params[:open_tabs]
  session[:caboose_station_return_url]  = params[:return_url]
  render :json => true
end

#plugin_countObject


19
20
21
# File 'app/controllers/caboose/station_controller.rb', line 19

def plugin_count
  render :json => Caboose::plugins.count  
end