The best way to show case the product of any firm, company, institute, organization or a business is publishing a website so that more no of people get to know about your product. Anything on the Internet goes viral. It is the best option to create a good, attractive website if you are a start-up company and waiting for more clients. A website that is delivered or displayed to the user in the way it is stored is called a static website. It cannot be changed.
It concentrates more on its looks rather than the functionality. Here it lacks the interactivity and sharing of information between the client and the server. It just displays whatever is already defined. When we come to the Dynamic websites, this includes responding to the client based on the query he requested for. This includes a database to store the values stored and retrieved to the user, the Server that responds to the user’s requests, a protocol which helps your query to be sent to the Server. For dynamic websites there are many languages to use, Ruby is one of them.
David Heinemeier Hansson has developed Ruby to develop web applications on an extremely productive framework called Ruby on Rails. Ruby is a flexible language with very fewer lines of code. Let us get to know more about Ruby on Rails.
What is Ruby?
Ruby is designed using different aspects and technologies such as pragmatism of Perl, a conceptual elegance of the Smalltalk, Ease of learning and using from Python.
Ruby is reflective, general purpose, object-oriented, and high-level programming language. It is similar and can be interpreted like Tcl, Python, Perl. It shares some features with the other object-oriented languages such as Java, Eiffel, Smalltalk, and Ada.
Seki Masatoshi, one of the developers of Ruby has created a program called Embedded Ruby (ERB). A website though uses many other languages for dynamism, beauty, security, etc. it must use HTML for sure. So, you can even embed different language codes into an HTML file according to your need. Here to insert or inject Ruby code into an HTML file, ERB is used. The whole page of code is read by the ERB word for word, along. But when it finds the Ruby piece of code it starts executing.
How to make an ERB document −
- Use <% and %> which are called scriptlet tags, to insert the Ruby code into your HTML file.
- To print out the result of the executed code included in the output, you need to enclose the Ruby code into the <%= and %> tags.
What is Rails?
- It is a web-application framework which is extremely productive.
- It is coded in Ruby.
- When compared to other Java frameworks, you can build a web application on Rails ten times faster.
- It is also used to develop web applications that use a database at the back-end.
- Compilation phase is not required.