app/controllers/trainings_controller.rb
# Prepares and assigns all the arrays used for the drop-down combo selects of the
# edit form.
# This should be invoked before any rendering of the edit views.
#
Prepares and assigns all the arrays used for the drop-down combo selects of the
edit form.
This should be invoked before any rendering of the edit views.
Prepares and assigns all the arrays used for the drop - down combo selects of the edit form . This should be invoked before any rendering of the edit views .
def assign_all_options_array
    @start_rest_options_array = 0.step(3600,5).collect{ |x| [(x > 0 ? sprintf("%2s\'%02.0f\"",x/60, x%60) : '-'), x] }
    @pause_options_array      = 0.step(1800,5).collect{ |x| [(x > 0 ? sprintf("%2s\'%02.0f\"",x/60, x%60) : '-'), x] }
    @exercise_options_array   = [[nil,nil]] + Exercise.to_dropdown()
    @step_type_options_array  = TrainingStepType.to_unsorted_dropdown( nil, :id, :i18n_description )
    @arm_aux_options_array    = ArmAuxType.to_dropdown( nil, :id, :i18n_description )
    @kick_aux_options_array   = KickAuxType.to_dropdown( nil, :id, :i18n_description )
    @body_aux_options_array   = BodyAuxType.to_dropdown( nil, :id, :i18n_description )
    @breath_aux_options_array = BreathAuxType.to_dropdown( nil, :id, :i18n_description )
  end
def assign_all_options_array @start_rest_options_array = 0 . step ( 3600 , 5 ) . collect { | x | [ ( x > 0 ? sprintf ( "%2s\'%02.0f\"" , x / 60 , x % 60 ) : '-' ) , x ] } @pause_options_array = 0 . step ( 1800 , 5 ) . collect { | x | [ ( x > 0 ? sprintf ( "%2s\'%02.0f\"" , x / 60 , x % 60 ) : '-' ) , x ] } @exercise_options_array = [ [ nil , nil ] ] + Exercise . to_dropdown ( ) @step_type_options_array = TrainingStepType . to_unsorted_dropdown ( nil , :id , :i18n_description ) @arm_aux_options_array = ArmAuxType . to_dropdown ( nil , :id , :i18n_description ) @kick_aux_options_array = KickAuxType . to_dropdown ( nil , :id , :i18n_description ) @body_aux_options_array = BodyAuxType . to_dropdown ( nil , :id , :i18n_description ) @breath_aux_options_array = BreathAuxType . to_dropdown ( nil , :id , :i18n_description ) end
Prepares and assigns all the arrays used for the drop-down combo selects of the
edit form.
Prepares and assigns all the arrays used for the drop - down combo selects of the edit form .