Ruby On Rails Classroom image

Pooja  Negi / Student / Web Technology

 
To post your Question Join Classroom
 
Lesson Topics's No:-  First|1 | 2|
Lessons:- Truly Static Pages

 

We see in Listing 3.3 the typical structure of an HTML document: A document type, or doctype, declaration at the top to tell browsers which version of HTML we’re using (in this case, HTML5);7 a head section, in this case with ‘‘Greeting’’ inside a title tag; and a body section, in this case with ‘‘Hello, world!’’ inside a p (paragraph) tag. (The indentation is optional—HTML is not sensitive to whitespace and ignores both tabs and spaces—but it makes the document’s structure easier to see.)

Now run a local server using

  $ rails server

 

and navigate to http://localhost:3000/hello.html. As promised, Rails renders the page straightaway (Figure 3.3). Note that the title displayed at the top of the browser window in Figure 3.3 is just the contents inside the title tag, namely, ‘‘Greeting.’’

Since this file is just for demonstration purposes, we don’t really want it to be part of our sample application, so it’s probably best to remove it once the thrill of creating it has worn off:

$ rm public/hello.html

 

We’ll leave the index.html file alone for now, but of course eventually we should remove it: We don’t want the root of our application to be the Rails default page shown in Figure 1.3. We’ll see in Section 5.3 how to change the address http://localhost:3000 to point to something other than public/index.html.  

 
 
 
image
Pooja   Negi

Skills    Ruby On Rails

Qualifications :- High School - SSN high school, College/University - HNBGU, College/University - SRHU,
Location :-Ranipokhari,Rishikesh,Uttarakhand,India
Description:- Student
Explore
 

  Students (0)