Showing posts with label hello world in ruby on rails. Show all posts
Showing posts with label hello world in ruby on rails. Show all posts

Thursday, December 14, 2017

Hello World in Ruby on Rails

In this article I would like to share with you a sample program that I wrote using Ruby on Rails framework to display hello world on the screen. The code is very easy to understand it uses MVC concepts and principles.

I am currently accepting programming and web development work kindly contact me in the following email address for further details. Thank you.

My email address are the following jakerpomperada@gmail.com and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.

My telephone number at home here in Bacolod City, Negros Occidental is (034) 4335675.




Sample Program Output


Program Listing

routes.rb

Rails.application.routes.draw do
  # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
    root 'hello#index' 
end

application.html.erb

<!DOCTYPE html>
<html>
  <head>
    <title>Hello World</title>
    <%= csrf_meta_tags %>

    <%= stylesheet_link_tag    'default', media: 'all', 'data-turbolinks-track': 'reload' %>
    <%= javascript_include_tag 'application', 'data-turbolinks-track': 'reload' %>
  </head>

  <body>
    <%= yield %>
  </body>
</html>

index.html.erb

<html>
<title> Hello World in ROR </title>
<style>
  body {
  font-family: arial;
  font-size: 16px;
  background-color: lightgreen;
  }
</style>
<br>
<h1> Hello World in Ruby on Rails </h1>

<br>

<p> Created By Mr. Jake R. Pomperada 2017</p>

</h1>

</html>