0
I Use This!
Activity Not Available

Project Summary

Simple-Ujs is a plugin that turns all of your view into Unobstrusive Javascripts views.

You don't need to learn any new syntax or a whole bunch of new helpers, you have just to call 1 helper (<%= flush_ujs_handlers_list %>) at the bottom of your master templates as close to the closing tag.

flush_ujs_handlers_list(path = {}, session_id = nil)

'path'

is the url path to the controller/action that will serve the javascript stored in the session with id of session_id.
The default path is /javascripts/ujs_handler and you can pass either a Hash or a String
'Session_id' is the name of the session that will store the javascript code. The default session name is 'ujs_script'

When you install this plugin it will automatically copy the file from /lib/simple_ujs/javascripts_controller.rb into your controllers folder. (From RAILS_ROOT run ruby vendor/plugins/simple_ujs/install.rb)

The content of that file is as follows.

class JavascriptsController < ApplicationController
def ujs_handler
render :update do |page|
page << session[:ujs_script]
end
end
endThere is a global setting SimpleUjs::Base.use_ujs that can be set to either true or false to activate or deactivate the SimpleUjs plugin.

The SimpleUjs plugin also moves all of your javascript includes called with the javascript_include_tag method to the bottom of the page right before the call to /javascripts/ujs_handler. I do this because I strongly agree with Douglas Crockford. I can be convinced to make it user-choice though if somebody has reason. The bottom of the page is the best place to insert javascript includes from a page load and performance perspective.

This plugin is for people like me that are sometimes lazy and believe that the best possible setting for any tool should always be the default one.

to install ruby script/plugin install http://simple-ujs.googlecode.com/svn/simple_ujs/

Tags

prototypehelpers ruby rubyonrails rubyonrailshelpers rubyonrailsplugin unobstrusivejavascript

In a Nutshell, simple-ujs...

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

MIT License
Permitted

Commercial Use

Modify

Distribute

Sub-License

Private Use

Forbidden

Hold Liable

Required

Include Copyright

Include License

These details are provided for information only. No information here is legal advice and should not be used as such.

All Licenses

This Project has No vulnerabilities Reported Against it

Did You Know...

  • ...
    Black Duck offers a free trial so you can discover if there are open source vulnerabilities in your code
  • ...
    compare projects before you chose one to use
  • ...
    there are over 3,000 projects on the Open Hub with security vulnerabilities reported against them
  • ...
    anyone with an Open Hub account can update a project's tags

 No code available to analyze

Open Hub computes statistics on FOSS projects by examining source code and commit history in source code management systems. This project has no code locations, and so Open Hub cannot perform this analysis

Is this project's source code hosted in a publicly available repository? Do you know the URL? If you do, click the button below and tell us so that Open Hub can generate statistics! It's fast and easy - try it and see!

Add a code location

Community Rating

Be the first to rate this project
Click to add your rating
   Spinner
Review this Project!
Sample ohloh analysis