For the image asset, you can use ActionController::Base.helpers.asset_path