Module: LiveTree

Defined in:
app/helpers/live_tree.rb

Overview

Version

0.1

Author

Emanuel Borsboom (www.epiphyte.ca/)

Copyright

Copyright © 2005 Emanuel Borsboom

License

MIT (see LICENSE)

See README for general information about LiveTree.

Defined Under Namespace

Modules: ClassMethods, LiveTreeHelper

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object

:nodoc:



10
11
12
13
# File 'app/helpers/live_tree.rb', line 10

def self.included(base) #:nodoc:
	super
	base.extend(ClassMethods)
end

Instance Method Details

#get_live_tree_data(item, options = {}) ⇒ Object

Renders data to return to a LiveTree data request.

Arguments:

  • item - Item to return.

  • options - May contain the following:

    • :get_item_name_proc - Proc object which, when called with an item, returns the name of the item to display. (by default, the item’s name is retrieved using the object’s name attribute).



227
228
229
230
231
# File 'app/helpers/live_tree.rb', line 227

def get_live_tree_data(item, options = {})	
	#data = LiveTreeHelper.get_live_tree_data(item, options, params)
	#render :text => data
	render :inline => '<%= _get_live_tree_data(item, options, params) %>', :locals => { :item => item, :options => options }
end

#live_tree_item_idObject

Returns the value of the item ID from the request’s params.



234
235
236
# File 'app/helpers/live_tree.rb', line 234

def live_tree_item_id
	params[:item_id]
end