ActionButton plugin

Plugin details

This provides helpers for creating a non-AJAX form containing a single button element. Using a button element allows the actions to be safe, not javascript dependent, and easily styled.

This plugin also includes a custom version of the lowpro javascript library, and a helper for adding a nobtrusive javascript snippet to handle AJAX form submission of the button.

Websitehttp://github.com/vigetlabs/action_button/ Repositorygit://github.com/vigetlabs/action_button.git Author Brian Landau Tags ActionView, helper, unobtrusive javascript, button, form LicenseMIT

Documentation

Install the plugin:
ruby script/plugin install git://github.com/vigetlabs/action_button.git

Create a delete button:

action_button 'delete-comment', 'Delete this Comment', 
               comment_path(@post, comment), {:method => :delete, :number => comment.id}




Embed an image and use custom classes and id for easier styling:

action_button 'delete-comment', image_tag('icons/delete.png', :alt => 'Add a Comment'),
                                new_comment_path(@post),
                                { :id => "commentDel", :class => 'delComment', 
                                  :form_class => 'delComment', :form_id => "delCommentForm" }



Further Documentation

There is currently no advanced documentation for this plugin.

New documentation

Edit plugin | Back in time (4 older versions) | Last edited by: scott, about 1 month ago