WIP on embed browse plugin

@jkeck I don't really like having this logic here. Is there best practice in Rails for putting some logic like this in a method somewhere? Does that live in this controller as a private method?