wycats / merb-plugins
- Source
- Commits
- Network (41)
- Issues (0)
- Downloads (12)
- Wiki (2)
- Graphs
-
Tree:
64f0abc
merb-plugins / merb_jquery
| name | age | message | |
|---|---|---|---|
| .. | |||
| |
LICENSE | Fri Dec 12 16:15:52 -0800 2008 | |
| |
README | Fri Dec 12 16:15:54 -0800 2008 | |
| |
Rakefile | Fri Dec 12 16:15:54 -0800 2008 | |
| |
TODO | Fri Dec 12 16:15:52 -0800 2008 | |
| |
lib/ | Fri Dec 12 16:15:53 -0800 2008 |
merb_jquery/README
merb-jquery
===========
Makes it easy to use jQuery in your application.
$ gem install merb_jquery
Add
require 'merb_jquery'
to your init.rb
$ rake merb:jquery:install
Installs the latest jQuery to public/javascripts
In your layout, inside <head>:
<%= jquery %>
In your views:
<% jquery do %>
$('#foo').something();
<% end %>
jquery is a helper method is a shortcut to
throw_content :for_query and catch_content :for_jquery
You still need to inlude jQuery javascript file manually, for instance,
using merb-assets:
# in init.rb
dependency "merb-assets", "0.9.10"
# in Erb layout
<%= js_include_tag "jquery" %>
# or in Haml layout
= js_include_tag "jquery"