Module: LazyCrud::ClassMethods

Defined in:
lib/lazy_crud.rb

Instance Method Summary collapse

Instance Method Details

#set_param_whitelist(*param_list) ⇒ Object

the list of parameters to allow through the strong parameter filter


34
35
36
# File 'lib/lazy_crud.rb', line 34

def set_param_whitelist(*param_list)
  self.param_whitelist = param_list
end

#set_resource(klass) ⇒ Object

all REST actions will take place on an instance of this class


20
21
22
# File 'lib/lazy_crud.rb', line 20

def set_resource(klass)
  self.resource_class = klass
end

#set_resource_parent(klass) ⇒ Object

for scoping the resource useful for nested routes, such as /event/:event_id/package/:package_id where Event would be the parent class and would scope the package


29
30
31
# File 'lib/lazy_crud.rb', line 29

def set_resource_parent(klass)
  self.parent_class = klass
end