Class: RubyMVC::Views::WebModelView

Inherits:
WebContentView show all
Includes:
Tagz
Defined in:
lib/ruby_mvc/views/web_model_view.rb

Direct Known Subclasses

ActiveRecordWebModelView

Instance Attribute Summary

Attributes inherited from WebContentView

#uri

Attributes inherited from View

#controller

Attributes included from ActionProvider

#actions

Instance Method Summary collapse

Methods included from ActionProvider

#action

Methods included from Toolkit::SignalHandler::ClassMethods

#signal, #signals, #valid_signal!, #valid_signal?

Methods included from Toolkit::SignalHandler

#signal_connect, #signal_disconnect, #signal_emit

Constructor Details

#initialize(row, options = {}) ⇒ WebModelView

Returns a new instance of WebModelView.



32
33
34
35
36
37
38
39
40
41
# File 'lib/ruby_mvc/views/web_model_view.rb', line 32

def initialize(row, options = {})
  @model_type = row.class
  if options.is_a? Hash
    @template = options[:template]
  else
    @template = options
    options = {}
  end
  super((@template ? @template.apply(row) : row), options)
end

Instance Method Details

#renderObject



43
44
45
# File 'lib/ruby_mvc/views/web_model_view.rb', line 43

def render
  render_properties
end