Class: WrapItRuby::ProxyController

Inherits:
ApplicationController show all
Defined in:
app/controllers/wrap_it_ruby/proxy_controller.rb

Instance Method Summary collapse

Methods included from Menu

#all_menu_items, #all_proxy_menu_items, #menu_config, #proxy_paths

Instance Method Details

#showObject



5
6
7
8
9
10
11
12
13
# File 'app/controllers/wrap_it_ruby/proxy_controller.rb', line 5

def show
  get_menu_item.then do |menu_item|
    target_path   = request.path.delete_prefix(menu_item["route"])
    target_domain = menu_item["url"]

    target_url  = "#{target_domain}/#{target_path}"
    @iframe_src = "/_proxy/#{target_url}"
  end
end