module RespondWithService::ClassMethods

Public Instance Methods

create_action(action, class_name) click to toggle source
# File lib/respond_with_service.rb, line 57
def create_action action, class_name
  define_method action do 
    find_model_instance class_name
    find_service_instance
    redirect_to_after_call
  end
end
respond_with_service(class_name, conf) click to toggle source
# File lib/respond_with_service.rb, line 51
def respond_with_service class_name, conf
  conf[:actions].each do |action|
    self.create_action action, class_name
  end
end