skinzer / rails-helloworld

first app tutorial

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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


Languages

Language:Ruby 82.2%Language:HTML 10.6%Language:CSS 3.3%Language:JavaScript 2.9%Language:CoffeeScript 1.0%