Even if your platform doesn??™t, you can
roll your own rather simply. As you??™ll see, as well as being a generally useful tool, layouts will
also become very useful to you later on down the line.
CHAPTER 9 n A DYNAMIC HELP SYSTEM 192
Following is the layout you??™ll be starting with for your application:
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
Pro DOM Scripting with Ajax, APIs and Libraries Chapter 9
<%= yield %>
In Rails, the <%= yield %> statement marks where each page??™s content will be inserted
into the layout. This simple layout includes a content area (the
with the id content) with
an application-wide header. You??™ll add an area for the help sidebar content later in the ???Styling
with CSS??? section.
This file can be found at app/views/layouts/application.rhtml in the example application.
Adding an Example Application Page
With the layout in place, you can turn your attention to the application pages themselves. For
the sake of this project you??™ll create only one application page, the suitably confusing Add A
Sprocket form. Users are bound to need some help with this.
Once again, the markup is simple:
Add A Sprocket ?
You can find this file at app/views/main/index.
Pages:
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271