Extending RJS

Is it possible to extend RJS and create another object, like ‘page’?
I’m trying to create a customized RJS for my own javascript library.
Thanks in advance

On Tuesday, June 20, 2006, at 12:42 PM, Alex MacCaw wrote:

Is it possible to extend RJS and create another object, like ‘page’?
I’m trying to create a customized RJS for my own javascript library.
Thanks in advance


Posted via http://www.ruby-forum.com/.


Rails mailing list
[email protected]
http://lists.rubyonrails.org/mailman/listinfo/rails

check out the KRJS plugin.
(http://www.agilewebdevelopment.com/plugins/krjs)

Using that you can just make a method like this in your controller.

def on_item_id_change
render :update do |page|
if params[:dom_value]==“”
page[‘item-form’].show
else
page[‘item-form’].hide
end
end
end

with an element like this in your view

<%= select ‘item’, ‘id’, options %>

_Kevin