Creating gallery home page

Let’s start styling the home page.

First we need a generic pages controller for the index page.

  1. Remove the public/index.html file.
  2. generate the “pages” controller with
    $ rails generate controller pages index

And the routes.rb file.

  PhotoGallery::Application.routes.draw do
    resources :albums do
      resources :photos

    root :to => 'pages#index'

After that, we get a temporary index page.

Temp index

What’s next? We’re going to take a look at “Adding swipejs library”.

overlaied image when clicked on thumbnail

Makzan | Ruby on rails 101 | Table of Content