I am new to Rails and I would like to study the Rhtml grammar and practice the basic elements in Rhtml. But I can't find enough resource for my study. Would any guys show some great blog or documents or articles to me? Any suggestion would be quite appreciated. Thanks. Wesley Chen.
on 2009-04-22 03:37
on 2009-04-22 03:46
> I am new to Rails and I would like to study the Rhtml grammar and practice > the basic elements in Rhtml. But I can't find enough resource for my > study. What did Google tell you about them? Tip: Also seek "eRB" - that's the usual language for *.html.erb files...
on 2009-04-22 04:39
Thanks to Phlip, I still can't find any useful resource when I search "ERB" by google. Any other suggestion? I want a book talking about rhtml, with most of the tags included. Thanks. Wesley Chen.
on 2009-04-22 05:10
On Apr 21, 9:36 pm, Wesley Chen <cjq....@gmail.com> wrote: > Wesley Chen. Check out the thread 'learning ruby' I just posted
on 2009-04-22 17:35
> I still can't find any useful resource when I search "ERB" > by google. > Any other suggestion? http://lmgtfy.com/?q=ruby+erb+tutorial [ BTW, The Rails mailing list is more appropriate for Rails questions. ]
on 2009-04-22 23:00
On Tuesday 21 April 2009 21:37:14 Wesley Chen wrote: > I want a book talking about rhtml, with most of the tags included. No you don't. That would be a horrible book. Here's what ERB is: <% some ruby code %> That will evaluate the string "some ruby code" as Ruby. <%= some ruby code %> That will evaluate the string "some ruby code" as Ruby, and insert its return value into the document. That is it. That's all. You can play with this in Rails by creating a .txt.erb document and inserting those tags into it -- obviously, with real Ruby, instead of just the text "some ruby code". Everything else you see in an "RHTML" document is HTML, not ERB. There is nothing magic about RHTML -- it is simply the combination of HTML and ERB. So, what you probably want is a book on HTML and CSS before you even start with Rails. You might also want a book on just Ruby, before you try Rails. Also, this list is about Ruby, not Rails. If you have Rails-specific questions, you should ask the Rails list.