0
irb(main):001:0> d = OurDomains.find(3)
=> #<OurDomains:0x000000056ea410 @id="2", @internal_domains=["1.com", "2.com", "3.com"], @external_domains=["2.com"]>

Using the above response as an example, could someone give me a guide on how to compare values in the internal_domains and external_domains array please? Specially, I am interested in displaying all the values in internal_domains that corresponds to a value in external_domains in my view.html.erb; that is "2.com" in this case

1
  • 1
    You want d.internal_domains & d.external_domains ? Intersection. Commented Jun 5, 2015 at 17:27

1 Answer 1

1
@internal_domains & @external_domains
Sign up to request clarification or add additional context in comments.

2 Comments

@user2782109 is my comment visible to you ?
What do you mean truncate the result?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.