Method: Anoubis::Data::Set#set_parent_model

Defined in:
app/controllers/anoubis/data/set.rb

#set_parent_model(action = '') ⇒ Object

Sets parent model according by type. Resulting data placed in self.etc.data.parent

Parameters:

  • action (String) (defaults to: '')

    type of used action in controller.

    • ‘index’ - for index action

    • ‘new’ - for new action

    • ‘create’ - for create action

    • ‘edit’ - for edit action

    • ‘update’ - for update action

    • ‘destroy’ - for defstroy action



15
16
17
18
19
# File 'app/controllers/anoubis/data/set.rb', line 15

def set_parent_model(action = '')
  self.etc.data = Anoubis::Etc::Data.new if !self.etc.data
  self.etc.action = action if action != ''
  self.set_current_tab
end