Skip to content

ameerjmc/rails-helloworld

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Quick Hello World App

Create new application

  • Command: rails new
  • CD into the newly created folder
  • Fire up the server: rails server
  • Navigate to: http://localhost:3000/ - you should see the “Welcome Aboard” page

Controller-View: Hello World

  • Create controller: rails generate controller home index

  • Open your Rails project in Sublime

  • Go to /views/home/index.html.erb

  • Replace the code with:

      <h1>Hello, World!</h1>
    
  • Delete the default “Welcome Aboard Page”: del public\index.html

  • Open config/routes.rb and add the following just below the first line:

      root :to => "home#index"
    
  • Refresh http://localhost:3000/ - it should now say, “Hello World!”

About

first app tutorial

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Ruby 82.2%
  • HTML 10.6%
  • CSS 3.3%
  • JavaScript 2.9%
  • CoffeeScript 1.0%