This may be too clever, but this could be re-written as:

```ruby
params.detect{ |k, v| k =~ /(.+)_id$/ and return $1.classify.constantize.find(v) }
```

I'm not a huge fan of setting the instance variable `@parent` here, because of the case where a parent isn't found.  I would rather this be re-written as a helper method or be called explicitly in the controller's action (i.e. `parent = find_parent`), that way the case where `nil` is returned could easily be handled.