Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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 %>
# =>

<%= page_header @post.title, 2 %>
# =>

=== 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 %>



  • ...