To Examples
HelloWorld Directions
- Open a command window:
Start >> All Programs >> Accessories >> Command Prompt
- 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
- Navigate to your folder for rails applications:
> cd it231-smith
- Create a new rails project named HelloWorld:
> rails new HelloWorld
- Navigate to the HelloWorld folder:
> cd HelloWorld
- Create a new rails controller and view:
> rails generate controller Hello mypage
- Open Windows Explorer (Start >> All Programs >> Accessories >>
Windows Explorer).
- Using Windows Explorer, navigate to
c:/it231-smith/HelloWorld/app/views/hello/mypage.html.erb.
- Right click on mypage.html.erb; select Open with JEdit.
- 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).
- Start the Rails server:
> rails server
- In a browser navigate to this URL:
> http://localhost:3000/hello/mypage