In an action in admin_controller, I called a method in the model ci.rb
The code is shown below:
In controller:
can_delete = Ci.is_ci_class_in_use(ci_type, @ci_classes)
Then in model:
class Ci < ActiveRecord::Base
def self.is_ci_class_in_use(ci_type,ci_classes)
@cis=self.find_all_by_citype(ci_type.to_s)
for ci in @cis
for ci_class in ci_classes
if ci.content.ci_class.to_i == ci_class.id.to_i
can_delete = 0
ci_number = ci.ci_number
break
else
can_delete = 1
end
break if can_delete==0
end
break if can_delete==0
end
return # I have to return two variables can_delete and
ci_number here.
end
end
How can I return the two variables can_delete and ci_number?
Please help.