Module: DataDisplay::Helpers

Includes:
Actions
Defined in:
lib/data_display/helpers.rb

Constant Summary collapse

LARGE_ACTIONS =
[:edit, :new, :show, :delete, :update, :create]
SHORT_ACTIONS =
[:index]
ACTIONS =
LARGE_ACTIONS + SHORT_ACTIONS

Instance Method Summary collapse

Methods included from Actions

#__data_display__

Instance Method Details

#current_actionObject



21
22
23
# File 'lib/data_display/helpers.rb', line 21

def current_action
  params[:action]
end

#display_short?Boolean

Returns:

  • (Boolean)


13
14
15
# File 'lib/data_display/helpers.rb', line 13

def display_short?
  ACTIONS.include?(current_action) and SHORT_ACTIONS.include?(current_action) or params_id?
end

#params_id?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/data_display/helpers.rb', line 17

def params_id?
  params[:id].present?
end