Create HTML files using RUBY

M

Marnen Laibow-Koser

Krithika said:
I am told to create static HTML page and asked to write something like
what Marnen has quoted. External library and CGI script are also not
required to use.
So let me try what Marnen has mentioned.

Could you tell me if I can do something like this

file_html = File.new("sample.html", "w+")
file_html.puts "<HTML><BODY BGCOLOR='green'>"
file_html.puts "<CENTER>This is a color</CENTER><br>"
file_html.puts "<CENTER><FONT COLOR='yellow'>This is
yellowww</FONT></CENTER>"
file_html.puts "</BODY></HTML>"
file_html.close()
system("start sample.html")

Why are you asking? In the time it took you to type that, you could
have executed it and inspected the result.

(BTW, your HTML code is of really poor quality.)
Thanks,
Krithika

Best,
 
K

Krithika San

I cant try it for next few days, there is some issue with my computer.
How do you think the code can be made better.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,776
Messages
2,569,603
Members
45,194
Latest member
KarriWhitt

Latest Threads

Top