Displaying 2 results from an estimated 2 matches for "another_method".
2009 Apr 08
4
Having trouble extending a class from a Rails plugin
...ould be much appreciated.
Thanks,
Jason
# vendor/plugins/my_plugin/init.rb
require ''my_plugin''
# vendor/plugins/my_plugin/lib/my_plugin.rb
module Jason
class MyClass
def a_method
# ...
end
end
end
# app/models/my_class.rb
module Jason
class MyClass
def another_method
# ...
end
end
end
$ script/console
>> Jason::MyClass.new.another_method
NoMethodError: undefined method `another_method'' for
#<Jason::MyClass:0x408b444>
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received t...
2006 Feb 16
10
Ruby class variables and access from view templates
I have an app that requires me to define a class variable (actually an
array) in a controller and then access it from within a view. It seems
that the class variables aren''t working right. Here is an example of
what I''m trying to do.
class DisplayController < ApplicationController
@@thumbnail_array = Array.new
...
def some_method
@@thumbnail_array = SomeModel.find_all