how to embed ruby code

I am very much a novice learning ruby code right now. I already know how to write the code and open it in a command prompt. My question is how do I embed it into an html document? how do I use rails? Im not sure where to go from here. I've been reading tutorials but havent found any clear direction. Can someone please steer me in the right place...

I'd take a look at Getting Started with Rails — Ruby on Rails Guides

Fred by Michael Hartl is a wonderful resource.