This repository is private.
All pages are served over SSL and all pushing and pulling is done over SSH.
No one may fork, clone, or view it unless they are added as a member.
Every repository with this icon (
) is private.
Every repository with this icon (
This repository is public.
Anyone may fork, clone, or view it.
Every repository with this icon (
) is public.
Every repository with this icon (
Russ Jones (author)
Tue Oct 06 17:09:36 -0700 2009
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Sun Jun 22 00:33:10 -0700 2008 | |
| |
CHANGELOG | Sat Mar 07 20:56:16 -0800 2009 | |
| |
README.textile | Tue May 12 17:34:41 -0700 2009 | |
| |
helpers/ | Tue Oct 06 17:09:36 -0700 2009 |
README.textile
What Is It?
These are some view helpers I use in Rails to better integrate jQuery UI into my sites.
I hope you find them useful.
TabsHelper
This helper simplifies the code required to use the jQuery UI Tab plugin.
<% tabs_for do |tab| %>
<% tab.create('tab_one', 'Tab 1') do %>
# ... insert tab contents
<% end %>
<% tab.create('tab_two', 'Tab 2') do %>
# ... insert tab contents
<% end %>
<% end %>
The above will generate this HTML in your view:
<div id="tabs">
<ul>
<li><a href="#tab_one"><span>Tab 1</span></a></li>
<li><a href="#tab_two"><span>Tab 2</span></a></li>
</ul>
<div id="tab_one">
# ... insert tab contents
</div>
<div id="tab_two">
# ... insert tab contents
</div>
</div>
Tabs will be rendered in the order you create them.
You can easily render a tab conditionally by appending your condition to the end of
the ‘create’ block as such …
<% tab.create('profile_tab', 'Your Profile') do %>
# ... insert tab contents
<% end unless @current_user.nil? %>
You can pass HTML options to either the parent DIV or any individual tab’s
DIV as you like …
<% tabs_for(:class => 'zippy') do |tab| %>
<% tab.create('tab_one', 'Tab 1', :style => 'background: #FFF') do %>
# ... insert tab contents
<% end %>
<% end %>
The default DOM ID for the parent div is … id=“tabs” … unless you pass in an HTML
option with a different value.
AccordionsHelper
This helper simplifies the code required to use JQuery UIs Accordion plugin.
Usage is identical to the Tabs helper.
<% accordions_for do |accordion| %>
<% accordion.create("dom_id", "accordion_title") do %>
# ... insert accordion contents
<% end %>
<% end %>







