> Please show us your code, and make it as simple as possible. Like this:
class Widget
def initialize(title)
@components = Array.new
end
def add_component(component)
@components << component
end
def component(uniqueId) # note: uniqueId is a string
@components.find { |comp| comp.getUniqueId == uniqueId }
end
end
================================================== =======
class SearchWidgetComponent
:attr_reader :uniqueId
def getUniqueId
@uniqueId
end
end
=============================
class SearchWidgetComparisonComponent
def getUniqueId
super
end
end
in my view index.rhtml, I have:
<% @sw.component("swComparisonComp1").some_func_call_ on_swcc()... %>
I get an error " NoMethodError in Region#index" "You have a nil object
when you didn't expect it!" in index.rhtml at the
some_func_call_on_swcc() line
--
Posted via
http://www.ruby-forum.com/.