embedded ruby tag

# Step 1: Define a Ruby variable
name = "John"

# Step 2: Use an embedded Ruby tag to display the variable in an HTML file
puts "Hello, <%= #{name} %>!"

# Step 3: Save the Ruby code in an ERB (Embedded Ruby) file, for example, index.erb
# The file may look like this:

# index.erb
# <html>
#   <head>
#     <title>Embedded Ruby Example</title>
#   </head>
#   <body>
#     <h1>Greetings:</h1>
#     <p><%= "Hello, #{name}!" %></p>
#   </body>
# </html>

# Step 4: Use a web framework like Sinatra to render the ERB file
require 'sinatra'

get '/' do
  erb :index
end

# Step 5: Run the Sinatra application
# You can use the terminal command: ruby your_app_file.rb
# Visit http://localhost:4567 in your web browser to see the result.