noesya/osuny

View on GitHub
app/controllers/admin/communication/websites/preview_controller.rb

Summary

Maintainability
A
0 mins
Test Coverage
F
37%
class Admin::Communication::Websites::PreviewController < Admin::Communication::Websites::ApplicationController
  def style
    render  body: @website.preview_style, 
            content_type: "text/css"
  end

  def assets
    path = request.path.partition('/assets').last
    url = "#{@website.url}/assets#{path}"
    data = URI(url).open.read
    render  body: data, 
            content_type: request.format.to_s
  end
end