• Stars
    star
    115
  • Rank 305,916 (Top 7 %)
  • Language
    Ruby
  • Created over 16 years ago
  • Updated about 13 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

JQuery UI helpers you can use in your Rails apps

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

More Repositories

1

js-data-helper

Rails helpers that dump data attributes into DOM elements, compatible with jQuery 1.2.3+, Prototype 1.6.1+ & Mootools 1.2+
Ruby
39
star
2

jquery-helpers-for-rails3

(NO LONGER MAINTAINED) A port of the unobtrusive Prototype helpers in Rails 3 to jQuery
26
star
3

silky-buttons-for-rails

a generator plugin that will copy image assets and view helpers into your app for some sexy button action
Ruby
15
star
4

github-search

a chrome extension for searching github
JavaScript
8
star
5

rack-options-request

Kill Microsoft Office Protocol Discovery Requests!
Ruby
7
star
6

acts_as_fulltext_indexed

my personal fork of acts_as_fulltext_indexed
Ruby
5
star
7

demo-engine-addon-dependency-conflicts

JavaScript
5
star
8

drawing-app

A small experiment with CANVAS while I wait for HTML 5
JavaScript
4
star
9

useful-modules-for-rails

A collection of modules I made for various apps
Ruby
4
star
10

example-ember-startup-kit-with-testing

example setup for ember testing
JavaScript
4
star
11

sslasher

simple ssl setup in development using nginx
Ruby
4
star
12

guild-wars-2-event-notifier

A web based event notifier for guild wars 2 written in Ember.js [MOVED]
JavaScript
3
star
13

jquery-ui-base-app

just a template for quick experimentations
3
star
14

google-custom-tile-maps

an experiment with google custom tile maps
JavaScript
3
star
15

hello-world-gem

just playing
Ruby
2
star
16

asset-dependency-manager

Rails plugin to manage js and css include dependencies
Ruby
2
star
17

goofin-with-rack

nothing to see here
2
star
18

dynamic-forms

experimenting with dynamic forms
JavaScript
2
star
19

presentation-materials

Presentation Materials
Ruby
2
star
20

dummy_app

just a testing ground for various things
JavaScript
2
star
21

dummy-terminal-app

nothing to see here
2
star
22

sslasher-example-app

demonstrating use of the slasher gem to ease setup of ssl in development with nginx
Ruby
2
star
23

gosu-js

a goso like game framework for javascript
2
star
24

jquery-data-linking-plugin-example

just playing around
2
star
25

acts-as-mysql-fulltext

fulltext searching in mysql for rails
Ruby
2
star
26

chat-app

a simple real time chat app
JavaScript
2
star
27

rails-23-templates

playing with templates in rails 2.3
Ruby
2
star
28

jquery.demo-text

jQuery plugin for putting demo text into input fields
JavaScript
2
star
29

sammy-data-location-proxy-bug

just a dummy app
2
star
30

js-tower-defence

a small js experiment using canvas
JavaScript
2
star
31

stanford-iphone-course

stepping through CS 193P
Objective-C
2
star
32

project-missing

nothing to see here - just some files I use as a base playing around
JavaScript
1
star
33

samantha

nothing to see here
JavaScript
1
star
34

dotfiles

dotfiles and misc scripts
Shell
1
star
35

embeddedjs

ERB clone in Javascript
JavaScript
1
star
36

ember-triple-nested-routing-example

JavaScript
1
star
37

gosu-playground

nothing to see here
1
star
38

sinblog

nothing to see here
Ruby
1
star
39

jquery-autocomplete-sandbox

just playing with jquery autocomplete
JavaScript
1
star
40

advent-o-code

JavaScript
1
star
41

SvelteKit-Prisma-Auth

JavaScript
1
star
42

websocket-node.js-sandbox

a play area for tinkering with websocket and node.js
JavaScript
1
star
43

ember-jasmine-standalone

JavaScript
1
star
44

sandbox-for-javascript-key-value-coding

nothing to see here
Ruby
1
star
45

app-engine-addon-theme-demo

JavaScript
1
star
46

my-game

building the basics of a 2d game in ruby (mostly) TDD style
Ruby
1
star
47

guild-wars-2

A web based event notifier for guild wars 2 written in Ember.js
JavaScript
1
star
48

rubygame-experiment

Following Practical Ruby Projects by APRESS (2008)
Ruby
1
star
49

mongo-sandbox

nothing to see here
1
star