SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Zealot
    Join Date
    Oct 2004
    Location
    world
    Posts
    128
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up simple hello world program

    Hi,
    I have installed ruby sucecssfully with xampp .
    As
    http://127.0.0.1:3000/ shows
    Welcome aboard
    You’re riding Ruby on Rails!

    now

    rails h:/xampp/htdocs/ruby1

    create the controller,view ,...othere files .

    in
    H:\xampp\htdocs\ruby1\app\controllers\student_controller.rb

    Code Ruby:
     
    class StudentController < ApplicationController
     
    def test
    greeting = "hello world!"
    end
     
    end

    now

    http://127.0.0.1:3000/student/test

    says

    Object not found!

    What is wrong ? please help .
    Thanks.

    I am running ruby186-26.exe &xampp...Windowsxp.

  2. #2
    SitePoint Guru
    Join Date
    Aug 2005
    Posts
    986
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Do you have a template file?

    Put this in ruby1/app/views/student/test.rhtml:

    Code:
    <&#37;= @greeting %>
    and change the controller to use @greeting instead of greeting.

    I don't know if that will solve the error...I've never had this "object not found" error. But the Ruby code will be correct.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •