Twitter Bootstrap Helper for Rails, support will_paginate & simple_form template
Twitter Bootstrap Helper for Rails, support will_paginate & simple_form template
Bootstrap is a toolkit from Twitter designed to kickstart development of webapps and sites. It includes base CSS and HTML for typography, forms, buttons, tables, grids, navigation, and more.
bootstrap_helper auto generates Bootstrap HTML codes.
include Bootstrap Helper in Gemfile;
gem 'bootstrap_helper', '3.2.2.0'or you can install from latest build;
gem 'bootstrap_helper', '4.2.2.1'edit your config/application.rb
SITE_NAME = "YOUR SITE NAME"in application.html.erb, replace `` with
define page title in your action
def index
@page_title = "Posts Index"
endwill render
Posts Index | YOUR SITE NAMErender_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"
"nav" do |li|
li in application.html.erb, replace `` with
render_body_tag auto inserts "controller name" & "action name" in to body class, and generates IE conditional comment.
in application.html.erb, place this helper
drop breadcrumb in your action
def show
@post = Posts.find(params[:id])
drop_breadcrumb("Posts", posts_path)
drop_breadcrumb(@post.title)
endit will generate breadcrumb with link for you
Home / Post / YourPostTitlein application.html.erb, place this helper
write notice message in your action, will generate bootstrap style notice message
def create
# ….
redirect_to posts_path, :notice => "Create Success!"
end
def update
redirect_to root_path, :flash => { :warning => "Update Success!" }
end
def no_permission
redirect_to root_path, :flash => { :error => "no permission" }
endSupport will_paginate, ~> 3.0.3
see example
Support simple_form, ~> 2.0.2
You can use simple_form 2.0 with bootstrap form template
{:class => "xxlarge"} , :hint => "this is post title" %>
Thanks Twitter for Bootstrap
Thanks Handlino for HandicraftHelper
Copyright (C) 2011 by xdite
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
No open issues yet, or sync has not completed.