jquery-ui-rails-helpers
文件大小: unknow
源码售价: 5 个金币 积分规则     积分充值
资源说明:JQuery UI helpers you can use in your Rails apps
h1. 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.

h2. 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:

# ... insert tab contents
# ... insert tab contents
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. h2. 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 %>

本源码包内暂不包含可直接显示的源代码文件,请下载源码包。