jeudi 22 octobre 2015

Ruby On Rails - Controller and view blank page

Apologies for the newbie question but I am stuck and unable to proceed on my Ruby on Rails tutorial.

I am doing a Ruby on Rails tutorial using a mac.

I have created a new Ruby on Rails project in Users/username/sites/simple_cms

I am using Webrick server

I started the server using rails s command and as expected, when navigating to the localhost:3000 the public index page was displayed.

I then added a Controller and view using the following command in the Route Directory: Rails Generate Controller demo index

Thw Controler and view were successfully created:

My routes file: SimpleCms::Application.routes.draw do get "demo/index"

My demo_Controller File: class DemoController < ApplicationController def index end end

My View file os now located in views/demo/index.html.erb:

Demo#index

hello world

I then started Webrick again and entered: http://localhost:3000/demo/index

but a blank page is displayed.

Help please as i'm stuck!

Thankyou

Aucun commentaire:

Enregistrer un commentaire