Multiple arguments in one `tagged?()` call?

Is there a way to use multiple arguments in the tagged? method? The docs say it takes a list, but I haven't been able to get it to work. Maybe it's super simple and I'm just missing it.

I'd like do something along the lines of if tagged?('tag_1', 'tag_2') or if tagged?('tag_1' || 'tag_2'), etc

The only way it works for me right now is if tagged?('tag_1') || tagged?('tag_2') || tagged?('tag_3') || tagged?('tag_4')

thanks!

tagged takes a string array, so it looks like you should be able to:

if tagged?(['tag_1', 'tag_2'])

But I haven’t tried it.

image001.jpg

1 Like

yeah i probably didn't try that exact syntax. thanks!

nope, testing with rspec, that doesn't work either...