Topic: I'd like to say "Hello World!"

puts "Hello World!"

I want to say hello to everybody. I'm the latest newbie, I've started with rails just a few days ago.

Really nice thing! But the rails-magic makes it hard to dig into it!

I come from the Perl-World. Programming websites is just a hobby.

Cheers

BBQ-Chef

Re: I'd like to say "Hello World!"

Try to do this:

- First make a new controll in your consele in this way: ruby script/generate controller Hello
- After this edit it and add this:

class HelloController < ApplicationController
 
  def hi
  render_text "Hi everyone!"
  end

- After this: http://127.0.0.1:3000/hello/hi

Proof this, and tell us whats happens!!

Re: I'd like to say "Hello World!"

Hey longhorn,

I tried. It's nice!

But...

On one hand I can not figure out why it does not say "Hello World!" and on the other hand - honestly - I thought about some pretty cool OOP stuff to say hello :-o

What do you think about this?
Would that be adequate to say hello to the forum?

class Newbie
  def initialize
    @welcome = "Hello world!"
  end
  def say
    @welcome
  end
end

shoutitoutloud = Newbie.new
puts shoutitoutloud.say()

Cheers

BBQ Chef

Re: I'd like to say "Hello World!"

You don't have to put () after the method ^^

Re: I'd like to say "Hello World!"

OK! Thanks!

You are right.

(I tested it on the console...)