Styling the Slideshows

Now that you’ve implemented a complex relationship, it’s time to spice things up a bit. Let’s take stock of where we are with the Photo Share application:

  • We have created a common layout that displays navigation links on every page to the three major areas: photos, categories, and slideshows.

  • The pages that deal with photos look pretty good.

  • The pages that deal with categories are functional, but could use some improvement.

  • We’re using cascading stylesheets to specify the visual styling of our pages and their elements.

We haven’t yet done anything with the slideshows, which are still using the generated scaffolding. The page that displays a list of all slideshows is the focal point that links to all the things you can do with slideshows: create them, edit them, delete them, and play them. Fixing up this page will have a tremendous visual impact, so this is a good place to start.

Currently, the list slideshows page looks like Figure 5-8. This is definitely ugly!

Current (ugly) slideshow listing

Figure 5-8. Current (ugly) slideshow listing

In the process of getting to this goal, you will learn about many new features. At the moment, we’ve defined only one slideshow, but later on you will create more slideshows.

The slideshow controller’s list action already gets the needed information from the database, so you don’t need to modify app/controllers/slideshows_controller.rb. The index method looks like this: ...

Get Rails: Up and Running, 2nd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.