Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/tonytonyjan/tj-bootstrap-helper
Tony Jian's Bootstrap helper.
https://github.com/tonytonyjan/tj-bootstrap-helper
Last synced: about 1 month ago
JSON representation
Tony Jian's Bootstrap helper.
- Host: GitHub
- URL: https://github.com/tonytonyjan/tj-bootstrap-helper
- Owner: tonytonyjan
- License: mit
- Created: 2012-07-24T06:00:37.000Z (over 12 years ago)
- Default Branch: master
- Last Pushed: 2012-07-26T00:26:02.000Z (over 12 years ago)
- Last Synced: 2024-04-24T05:03:37.093Z (8 months ago)
- Language: Ruby
- Size: 2.27 MB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rdoc
- License: MIT-LICENSE
Awesome Lists containing this project
README
= TJBootstrapHelper
This is Tony Jian's Bootstrap helper gem.
== Install
gme 'tj_bootstrap_helper'
or
gem 'tj_bootstrap_helper', :git => "git://github.com/tonytonyjan/tj-bootstrap-helper.git"== Helpers Usage
=== page_header<%= page_header @post.title %>
# =><%= @post.content %>
<%= page_header @post.title, 2 %>
# =><%= @post.content %>
=== spans
==== Render Array<%= spans %w(asfd qwer zxcv), fluid: true do |word| %>
<%= word %>
content
<% end %># =>
asfd
content
qwer
content
zxcv
content
==== Render Resources
<%= spans @posts, :span => 3, :slice => 2 do |post| %>
<%= post.title %>
<%= post.content %>
<% end %># =>
<%= post.title %>
<%= post.content %>
<%= post.title %>
<%= post.content %>
...
<%= post.title %>
<%= post.content %>
<%= post.title %>
<%= post.content %>
=== thumbs
The usage of +thumbs+ is nothing more than +spans+,
but it requires a parameter of image method name correspondding to each resource.==== Thumbnails Only
<%= thumbs @posts, "image_url", :span => 2, :slice => 2 %>
# =>
...
==== With Caption
<%= thumbs @posts, "image_url" do |post| %>
<%= post.title %>
<%= post.content %>
<% end %>
# =>
-
<%= image_tag post.image_url %>
<%= post.title %>
<%= post.content %>
...