Class: Faalis::Dashboard::ApplicationController

Inherits:
ApplicationController show all
Includes:
DSL
Defined in:
app/controllers/faalis/dashboard/application_controller.rb

Instance Attribute Summary

Attributes included from DSL

#_override_views

Instance Method Summary (collapse)

Methods included from Sections::Sidebar

#setup_sidebar, #sidebar

Methods included from Sections::ResourceDestroy

#before_destroy_hook, #destroy

Methods included from Sections::ResourceShow

#_show_fields, #collect_model_fields_for_show, #show, #show_hook, #show_properties

Methods included from Sections::ResourceCreate

#_new_form_fields, #all_valid_columns_for_form, #before_create_hook, #before_update_hook, #collect_model_fields_for_form, #create, #creation_params, #edit, #edit_hook, #form_properties, #new, #new_hook, #reflections_hash, #update

Methods included from Sections::ResourcesIndex

#fetch_and_set_all, #fetch_index_objects, #index, #index_hook, #index_properties

Methods included from Sections::Resource

#_resource_title, #_resources, #_route_engine, #_route_name, #action_buttons, #attachment_fields, #errorful_resopnse, #guess_edit_route, #guess_index_route, #guess_new_route, #guess_show_route, #has_attachment?, #model, #model_name, #namespace, #plural_name, #setup_named_routes, #successful_response, #symbolify_keys

Methods inherited from ApplicationController

#set_locale

Instance Method Details

- (Object) redirect_to_404(e) (private)



33
34
35
36
37
38
# File 'app/controllers/faalis/dashboard/application_controller.rb', line 33

def redirect_to_404(e)
  respond_to do |f|
    f.html { redirect_to dashboard_not_found_url }
    f.js { render 'faalis/dashboard/not_found' }
  end
end

- (Object) setup_header (protected)



20
21
22
23
24
# File 'app/controllers/faalis/dashboard/application_controller.rb', line 20

def setup_header
  @dashboard_section_title = t(controller_name.underscore)
  @dashboard_resource_name = t(controller_name.underscore.singularize)
  @dashboard_section_slug  = t(action_name)
end

- (Object) user_not_authorized (private)



28
29
30
31
# File 'app/controllers/faalis/dashboard/application_controller.rb', line 28

def user_not_authorized
  flash[:alert] = t('faalis.not_authorized')
  redirect_to new_user_session_path
end