Forum: Ruby PHP to Ruby Conversion

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
99cb7d038f205ea0e4b9676abac856ab?d=identicon&s=25 Aleeious MMO (aleeious)
on 2014-06-24 05:43
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
54404bcac0f45bf1c8e8b827cd9bb709?d=identicon&s=25 7stud -- (7stud)
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.
This topic is locked and can not be replied to.