There is a `.nil?` method but I would probably flip this around

```ruby
def filter_groups(params)
  if params[:filter]
    Group.send(params[:filter])
  else
    Group.all
  end
end
```

I would also probably push all of this logic into a model. In this case, I think it's ok to put it into the `Group`.

```ruby
class Group
  def self.filtered_by(options="all")
    send(options)
  end
end
```