Moved code back to erb file