Module: Cruddy::Controller::ClassMethods

Defined in:
lib/cruddy/controller.rb

Instance Method Summary collapse

Instance Method Details

#actions(*methods) ⇒ Object

choose which actions the controller inherits



5
6
7
8
9
10
# File 'lib/cruddy/controller.rb', line 5

def actions(*methods)
  methods_to_remove = [:index, :show, :new, :create, :edit, :update, :destroy].reject { |m| methods.include?(m) }
  methods_to_remove.each do |method_to_remove|
    undef_method method_to_remove
  end
end