simple-layout¶ ↑
In your Gemfile:
roup :development do gem "simple-layout" # Last officially released gem nd
From console:
$rails g layout simple # To generate simple layout $rails destroy layout simple # To remove files related to simple layout
In your controller:
class PostsContorller < ApplicationController layout 'simple' ... end
To detailize your layout, modifiy app/views/layout/simple.html.erb
That’s it. Hope it’s simple!!
Contributing to simple-layout¶ ↑
For those who wants to create your layout and share with others, please make your .css to match to the layout below:
You need to make the following files and directories
1. styles.css 2. <layout-name>/images directory with files used by styles.css 3. index.html to show an example 3. <layout-name>.html.erb, which will be copied to app/views/layouts
If you can, send me a pull request. You can also send it to me, so that your layout can be shared.
+-- #header -----------------------------------------------------------------------------------+ | +-- #logo --+ | | | | | | +-----------+ | +----------------------------------------------------------------------------------------------+ +-- #navigatgion ------------------------------------------------------------------------------+ | | +----------------------------------------------------------------------------------------------+ +- #sidebar -+ +--- #contents -----------------------------------------------------------------+ | | | +-- #notice ----------------------------------------------------------------+ | | | | | | | | | | +---------------------------------------------------------------------------+ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | +------------+ +-------------------------------------------------------------------------------+ +-- #footer -----------------------------------------------------------------------------------+ | | +----------------------------------------------------------------------------------------------+ Example #header img { border: 1px sold black }
Copyright¶ ↑
Copyright © 2012 Allen Kim. See LICENSE.txt for further details.