Module: TheSortableTreeController::DefineVariablesMethod

Included in:
Rebuild, ReversedRebuild
Defined in:
app/controllers/the_sortable_tree_controller.rb

Overview

include TheSortableTreeController::ReversedRebuild include TheSortableTreeController::Rebuild

Instance Method Summary collapse

Instance Method Details

#the_define_common_variablesObject



7
8
9
10
11
12
# File 'app/controllers/the_sortable_tree_controller.rb', line 7

def the_define_common_variables
  collection = self.class.to_s.split(':').last.sub(/Controller/,'').underscore.downcase                 # recipes
  variable   = collection.singularize                                                                   # recipe  
  klass      = self.respond_to?(:sortable_model) ? self.sortable_model : variable.classify.constantize  # Recipe
  ["@#{variable}", collection, klass]
end