Permalink
Browse files

fixed render_page_title related documentations in README.md

  • Loading branch information...
1 parent e60c260 commit d889328f3819a91bd640674d7af245e1c2ebf782 @rickypai rickypai committed Feb 26, 2012
Showing with 23 additions and 23 deletions.
  1. +23 −23 README.md
View
46 README.md
@@ -24,29 +24,29 @@ gem 'bootstrap_helper', :git => "git://github.com/xdite/bootstrap-helper.git"
#### SETUP
-edit your `config/application.rb `
+edit your `config/application.rb ` add to first line
- SITENAME = "YOUR SITE NAME"
+ SITE_NAME = "YOUR SITE NAME"
in `application.html.erb`, replace `<title>` with
- <%= render_page_title %>
+ <%= render_page_title %>
define page title in your action
- def index
- page_title("Posts Index")
- end
+ def index
+ drop_page_title("Posts Index")
+ end
will render
-
- <title>Posts Index &raquo; YOUR SITE NAME</title>
+
+ <title>YOUR SITE NAME &raquo; Posts Index</title>
### render_list
render_list generates ul & li, auto append: "first", "last" class . If link matches current controller and acttion, it will auto add "active" class. Perfact for "menu"
- <%= render_list :class => "nav" do |li|
+ <%= render_list :class => "nav" do |li|
li << link_to(t("menu.topics"), topics_path)
li << link_to(t("menu.wiki"), wikis_path )
li << link_to(t("menu.sites"), sites_path )
@@ -57,35 +57,35 @@ render_list generates ul & li, auto append: "first", "last" class . If link matc
in `application.html.erb`, replace `<body>` with
- <%= render_body_tag %>
+ <%= render_body_tag %>
render_body_tag auto inserts "controller name" & "action name" in to body class, and generates IE conditional comment.
- <!--[if lt IE 7 ]>
- <body class="topics-controller index-action ie6"><![endif]-->
- <!--[if gte IE 7 ]>
- <body class="topics-controller index-action ie"><![endif]-->
- <!--[if !IE]>-->
- <body class="topics-controller index-action">
- <!--<![endif]-->
+ <!--[if lt IE 7 ]>
+ <body class="topics-controller index-action ie6"><![endif]-->
+ <!--[if gte IE 7 ]>
+ <body class="topics-controller index-action ie"><![endif]-->
+ <!--[if !IE]>-->
+ <body class="topics-controller index-action">
+ <!--<![endif]-->
### breadcrumb
in `application.html.erb`, place this helper
- <%= render_breadcrumb %>
+ <%= render_breadcrumb %>
drop breadcrumb in your action
- def show
- @post = Posts.find(params[:id])
- drop_breadcrumb("Posts", posts_path)
- drop_breadcrumb(@post.title)
+ def show
+ @post = Posts.find(params[:id])
+ drop_breadcrumb("Posts", posts_path)
+ drop_breadcrumb(@post.title)
end
it will generate breadcrumb with link for you
- Home / Post / YourPostTitle
+ Home / Post / YourPostTitle
### notice_message

0 comments on commit d889328

Please sign in to comment.