Showing posts with label helper. Show all posts
Showing posts with label helper. Show all posts

Sunday, November 29, 2009

Swfobject helper

This Rails plugin makes including an swf object easier, no more writing javascript for that, just plain ruby.

To install this plugin:
  script/plugin install git://github.com/japetheape/swfobject_helper.git
Make sure swfobject.js is in your javascripts dir (download here:http://code.google.com/p/swfobject/)

http://agilewebdevelopment.com/plugins/swfobject_helper_plugin

Monday, March 9, 2009

drails

drails allows you to use RJS with Dojo in your Rails application. It completely replaces the need for Prototype/Scriptaculous in your application and let's you use the powerful Dojo Toolkit as your Javascript library.

Examples:
=========
The best way to see how to use drails helpers is to view the specs. Most people will be interested in prototype_helper_spec.rb and scriptaculous_helper_spec.rb. For a quick taste, here is an example of how you can create an link that replaces the "success_response" div on successful completion of an ajax call with the HTML returned by the server:

<%=link_to_remote "my link", :update => [ :success => "_response" ], :url => { :action => "myaction" }%>
<div id="success_response">...some html to be replaced...</div>

To see the usages for the drails generators for dojo modules, dijits, and build profiles, type this from the command line:

cd my_rails_app; script/generate dojo

drails comes with some handy rake tasks for incorporating dojo builds. To see what is available, type this from the command line.

cd my_rails_app; rake -T | grep drails

http://github.com/foobarfighter/drails/tree/v1.0.0

Tuesday, November 4, 2008

How to observe more fields with AJAX helper

The observe_field AJAX helper allows to observe one field; if there is a change, it calls the specified method on the server side. It is possible to attach one value for the call.

This is enough if we have one text box search for searching over multiple columns or for a full-text search.

For a more complicated filtering functionality with more fields there are two main problems with the observe_field helper:

  • how to specify more parameter values in the observe_field helper.
  • it is necessary to write a observe_field call for each field.
http://www.valibuk.net/2006/08/how-to-observe-more-fields-with-ajax-helper/