Ruby On Rails is the fashionable way of developing web applications at the moment. But if you’ve never used Rails, it is not at all obvious how to get started with it. In this article, I’ll explain how to create a first Ruby On Rails application.
First Install Ruby and Rails…
This tutorial assumes that you have both Ruby and Rails installed. Furthermore, it also assumes that you have a passing familiarity with the Ruby language. For a guide to installing Ruby and doing (...)
Truth of the matter is, I’m not bothered one way or the other whether people put the odd <p>, <h2> or <li> into their Ruby code or not. On browisng through my copy of Agile Web Development With Rails (2nd Edition) I note that the authors, Dave Thomas and DH Hansson, don’t seem too bothered either. See examples on pages 79, 428, 562 (etc.) so I’m really in such bad company.
I am generally in sympathy with keeping Ruby and HTML separate - as I said in the article above...
On the whole, Ruby code belongs in Ruby code files and HTML formatting belongs in HTML files. While embedded Ruby provides an easy way of letting a view and a controller communicate, it is generally better to keep embedded Ruby code short and simple and put more complex Ruby code into Ruby code files.
But I’m not going to make a religion of it. An odd <p> here or there (so to speak) won’t keep me awake at night
Anyway, thanks for the comments. Glad you enjoyed the article.