Skip to content
Eric Draut edited this page Oct 8, 2018 · 18 revisions

Hooch is a library of javascript behaviors with Rails helpers. It is completely independent of your look-and-feel, you can bind a behavior to your own dom elements with your own css.

Install It

In your gemfile

gem 'hooch'

Use it

<ul <%= tab_set('user_tab', type: :ajax, default_tab: params[:user_tab] || 'profile') %> class="my_tab_class">
  <li <%= tab_trigger('profile') %> href="<%= profile_user_path(user) %>>Profile</li>
  <li <%= tab_trigger('friends') %> href="<%= friends_user_path(user) %>>Friends</li>
  <li <%= tab_trigger('posts') %> href="<%= posts_user_path(user) %>>Posts</li>
</ul>

<section class="my_content_class" <%= tab_content('profile') %>></section>
<section class="my_content_class" <%= tab_content('friends') %>></section>
<section class="my_content_class" <%= tab_content('posts') %>></section>

All the Available Behaviors

Clone this wiki locally