[RoR] problems using own class

J

Jonathan Heinen

Hi,

I just build my own class that looks like this


class Rechnungsdaten
attr_accessor :nummer
end


I saved this file as "rechnungsdaten.rb" in the models folder.
When I use this code:


@rechnung = Rechnungsdaten.new
@rechnung.nummer = @rechnungsnummer


I get this error message in my browser:


undefined method `nummer=' for #<Rechnungsdaten:0x3976148>


How could this be? I can't understand that! Or do I have to include the
class by using requieres? .... But why doesn't rails say me that it
can't find >> Rechnungsdaten <<?

Jonathan
 
J

Jonathan Heinen

Hi,

I solved this problem with the help of a german RoR forum.

The problem is that you have to reload the server when you made changes
in the source!
But you also can add

include Reloadable

to your class so it will be reloaded automaticly!

Jonathan
 
J

Jonathan Heinen

Hi Jan,

a little bit foolish but ...

Jan said:
www.rubyforen.de is a german Ruby forum not (only) a RoR forum! ;)

rubyforen es the german plural for forum so it's forums the page is
called rubyforums. The page has this name because there are a lot of
forums there and one, the one I refere to is the RoR forum =)


So jetzt habe ich mich zumindest als Deutscher geoutet und die native
englisch Sprecher wissen jetzt auch wieso mein Englisch so scheisse ist =)

Jonathan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,777
Messages
2,569,604
Members
45,234
Latest member
SkyeWeems

Latest Threads

Top