Over a million developers have joined DZone.
{{announcement.body}}
{{announcement.title}}

Generic Actions

DZone's Guide to

Generic Actions

·
Free Resource
// Generic Actions



  def selector selector_type
    # do normal selector crap
    # TODO: iterate model... find id's build selection
    # find text's build searchable intellitext actions
    # bind information
    # ------------------------

    # render specified template
    @dKlass = instance_eval("#{selector_type.capitalize}")
    tpl_name = "#{selector_type}_selector"
    @iobj = instance_eval("#{selector_type.capitalize}.find(:all)")
    render :partial => "selector"
  end

  def method_missing(method_id, *arguments)
    if match = /selector_(\w*)/.match(method_id.to_s)
        selector( match[1] )
    end
  end

Topics:

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}