Run:
rails g controller StaticPages index
In config/routes.rb
add:
root "static_pages#index"
###Show variable contents from controller in view### ####Controller####
class StaticPagesController < ApplicationController
def index
@LOL = "OLOLO"
end
end
####View####
<%= @LOL %>
###Request external page and show html###
require "open-uri"
class StaticPagesController < ApplicationController
def index
@response = open("http://ya.ru/").read
end
end
<%= @response.html_safe %>