I am interested in learning ruby for web development. I was looking into ruby on rails, but on my PHP code i wrote a very simple template engine available here: https://github.com/Aleeious/AleeiousMMO/blob/maste.... I was wondering how difficult it would be to convert it to ruby and use it as my template engine instead of Ruby on Rails. Any assistance would be greatly appreciated. Sincerely, Aleeious
on 2014-06-24 05:43
on 2014-06-24 20:06
Ruby itself is a full fledged programming language, and as such it can be used to do anything--including web programming. Ruby on Rails(R0R) is a web framework that is written in ruby. Web frameworks are typically massive productions that enable you to produce (supposedly) bullet proof web sites by employing the wisdom of experts--if you have the time/ability to figure out how they work. There are also more minimal web frameworks written in ruby of which Sinatra is probably the most famous. They are a reaction to the complexity of Ruby on Rails. See here: http://codecondo.com/12-small-ruby-frameworks/ In addition, ruby already has a template engine in its Standard Library called 'erb' (embedded ruby). require 'erb' my_template = "Hello <%= greeting %>!" greeting = "world" renderer = ERB.new(my_template) result = renderer.result() puts result --output:-- Hello world! And then there are thousands of other template engines written in ruby by people like yourself: https://www.ruby-toolbox.com/categories/template_engines To summarize, you can use ruby to do your web programming, or you can step up to a lightweight framework like Sinatra, or you can employ a heavy weight web framework like ROR. Independent of how you decide to do your web programming, you can choose from many template engines, or convert your own to ruby.