1 / 4

Simple Rails Template

Simple Rails Template. <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Hello, User</title>

guthriea
Download Presentation

Simple Rails Template

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Simple Rails Template <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Hello, User</title> </head> <body> <p> This page was fetched at <%= Time.now() %> </p> </body> </html> CS 142 Lecture Notes: Rails Controllers and Views

  2. Control Structures in Templates ?xml version="1.0" encoding="utf-8"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>Rails Parameters</title> </head> <body> <p> The <code>params</code> hash contains the following values: </p> <% params.each do |key, value| %> <p><%= key %>: <%= value%></p> <% end %> </body> </ht CS 142 Lecture Notes: Rails Controllers and Views

  3. CS 142 Lecture Notes: Rails Controllers and Views

  4. Templates printf("The capital of %s is %s\n", state, capital); vs. print("The capital of); print(state); print(" is "); print(capital); print("\n"); CS 142 Lecture Notes: Rails Controllers and Views

More Related