Hello World! di Ruby on Rails

talk less do more… langsung aja ke tutorial nya ya!

Untuk server gw make ubuntu 9.04 yang udah gw install server apache …. jadi untuk instalasi server ga dibahas disini … kita mulai dari instalasi ruby and rails

$ sudo apt-get install ruby rails
 
$ mkdir ~/www
 
$ mkdir ~/www/rails
 
$ cd www/rails
 
$ rails firstrails
 
$ cd firstrails
 
$ ./script/server
 
$ ./script/generate controller helloworld
 
$ vim app/controllers/helloworld_controller.rb
 
class HelloworldController < ApplicationController
  def index
    @msg = "Hello World!"
  end
end
 
$ vim app/views/helloworld/index.rhtml
<h1><%= @msg %></h1>

buka deh

http://localhost:3000/helloworld

CMIIW…

Semoga bermanfaat <img src="http://www.de3site.com/blog/wp-content/plugins/kaskus-emoticons/emoticons/15.gif" style="border:none;background:none;" alt=":)" title="Hello World! di Ruby on Rails" />

Sumber:

http://www.cecep.web.id/archives/51

http://guides.rubyonrails.org/

Share this Post:
Digg Google Bookmarks reddit Mixx StumbleUpon Technorati Yahoo! Buzz DesignFloat Delicious BlinkList Furl

2 Responses to “Hello World! di Ruby on Rails”

  • eR says:

    wogh, malah belajar ruby lo ?!

    OOT : pantes ga masuk RSS reader gw, dipindahin ke /blog/ toh, berarti ada directory laen nih :p

  • de_3 says:

    @eR
    belajar apa aja kan ga ada masalah :D ….

  • Leave a Reply:

    Name (required):
    Mail (will not be published) (required):
    Website:
    Comment (required):
    XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">