I think you can reuse the [action](https://github.com/mortardata/mortar/blob/master/lib/mortar/helpers.rb#L226) helper from helper.rb to do this for free.  You'll need to `include Mortar::Helpers` to get access to that functionality.