26 March 2008 ~ 1 Comment

Rails Plugin: WinnScriptatype

Making an Ajax checkbox just got easy. This very simple plugin was built for my own use. The idea was to make one call for my checkbox, update to the database, and an effect. This plugin is easy to use and install, i dont have it setup in an svn yet so you will need to download it and place it in RAILS_ROOT/vendor/plugins/HERE.

I had been working on this plugin for a few weeks in making a new application. I kept writing the “input, Ajax.Request and, Effect.Fade”, so i needed a way to make that fast and do what i need. And out came this handy plugin!

[ruby]
# Lets use this new plugin
checkbox_do_fade(‘theDiv’, ‘CheckboxID’, {:controller => ‘todo’, :action => ‘finish’, :id => todo.id}, {:userid => user.id})

[/ruby]

Here is an over view of the options:

[ruby]
checkbox_do_fade(‘*’, ‘**’, {***}, {****})

[Element ID]* This is the name of the element you want to effect such as a div or table (tr,td)…

[Checkbox ID]** This is the id of the checkbox it self

[URL/path]*** this is the url for the update to take place NOTE: always use controller,
action, and id DO NOT place other variables in this block that is for the next block.

[URL/path options]**** This block is used for url options like so: (/path/to/1?userid=1) as you see
userid is 1, this is done by using the url options block. You may send an unlimited number of
url options with this.

# Below are the ONLY supported calls
checkbox_do_fade # This will fade the element
checkbox_do_puff # This will puff the element
checkbox_do_blindup # and so on…
checkbox_do_dropout # again…
[/ruby]

Ready to start using it? Download WinnScriptatype

You will also need help installing this plugin so take a look at Ruby on Rails Railway : WinnScriptatype.

Comments are closed.