Class: RubyMVC::Views::WebView

Inherits:
View
  • Object
show all
Defined in:
lib/ruby_mvc/views/web_view.rb

Overview

This is a more sophisticated view control vs. the standard toolkit widget.

Instance Attribute Summary

Attributes inherited from View

#controller, #widget

Instance Method Summary collapse

Methods inherited from View

create_widget, #initialize, #method_missing, #peer, widget, widget_def

Constructor Details

This class inherits a constructor from RubyMVC::Views::View

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class RubyMVC::Views::View

Instance Method Details

#load(model, options = {}, &block) ⇒ Object

This method is used to load the view with the information in the table model.



38
39
40
41
42
43
44
45
46
47
# File 'lib/ruby_mvc/views/web_view.rb', line 38

def load(model, options = {}, &block)
  cols = columns(model, options)
  if r = options[:renderer]
    html = r.render(model, cols, options[:renderer_options])
    puts "HTML:\n#{html}"
    widget.load_html(html)
  else
    raise ArgumentError,"renderer not specified"
  end
end