Module: TheSortableTreeController::DefineVariablesMethod
- Included in:
- ExpandNode, Rebuild, ReversedRebuild
- Defined in:
- app/controllers/the_sortable_tree_controller.rb
Overview
include TheSortableTreeController::Rebuild include TheSortableTreeController::ExpandNode include TheSortableTreeController::ReversedRebuild
Instance Method Summary collapse
Instance Method Details
#the_define_common_variables ⇒ Object
8 9 10 11 12 13 14 |
# File 'app/controllers/the_sortable_tree_controller.rb', line 8 def the_define_common_variables collection = self.class.to_s.split(':').last.sub(/Controller/,'').underscore.downcase # 'recipes' collection = self.respond_to?(:sortable_collection) ? self.sortable_collection : collection # 'recipes' variable = collection.singularize # 'recipe' klass = self.respond_to?(:sortable_model) ? self.sortable_model : variable.classify.constantize # Recipe ["@#{variable}", collection, klass] end |