To Examples

HelloWorld Directions

 

  1. Open a command window:
    Start >> All Programs >> Accessories >> Command Prompt
     
  2. If you haven't done so already, create a folder on the c: drive for your rails applications (replace ssmith with your last name):
    > mkdir it231-smith
     
  3. Navigate to your folder for rails applications:
    > cd it231-smith
     
  4. Create a new rails project named HelloWorld:
    > rails new HelloWorld
     
  5. Navigate to the HelloWorld folder:
    > cd HelloWorld
     
  6. Create a new rails controller and view:
    > rails generate controller Hello mypage
     
  7. Open Windows Explorer (Start >> All Programs >> Accessories >> Windows Explorer).
     
  8. Using Windows Explorer, navigate to
    c:/it231-smith/HelloWorld/app/views/hello/mypage.html.erb.
     
  9. Right click on mypage.html.erb; select Open with JEdit.
     
  10. Copy the source code in mypage.html.erb to the ClipBoard (Control-C), select all of the contents of app/views/hello/mypage.html.erb (Control-A), then paste the contents of the clipboard into app/views/hello/mypage.html.erb (Control-V).
     
  11. Start the Rails server:
    > rails server
     
  12. In a browser navigate to this URL:
    > http://localhost:3000/hello/mypage