Method: AgileFormFields::Method#render

Defined in:
app/models/agile_form_fields/method.rb

#renderObject

Render file_select AgileRails form field code



46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
# File 'app/models/agile_form_fields/method.rb', line 46

def render
  # might be defined as my_method or MyClass.my_method
  clas, method = @yaml['eval'].split(/\.|\,/).map(&:strip)
  if method.nil?
    if @env.respond_to?(clas)
      @html += @env.send(clas, @record, @yaml, @readonly)
      return self
    end
  else
    klass = clas.camelize.constantize
    if klass.respond_to?(method)
      @html += klass.send(method, @record, @yaml, @readonly)
      return self
    end
  end   
  @html += "Error: #{@yaml['name']} : #{@yaml['eval']} not defined!"
  self
end