This method is using the old style `respond_to`. You should be able to replace `respond_to do |format| ... end` with:

```ruby
respond_with @group
```
That will do everything except set flash messages. You can customize those via `notice` or `alert` passed to `respond_with`, or specify them in config/locales/en.yml.

Finally, since you're setting an error message in this line, it should probably be an alert and not a notice.