I think it would be worth extracting the logic to generate side by side URLs to a helper. What about:
```ruby
  def side_by_side_url(site, mapping=nil)
    url = "http://#{site.default_host.hostname}.side-by-side.alphagov.co.uk/__/#"
    url << mapping.path if mapping
    url
  end
```