Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Ruby > [RoR] problems using own class

Reply
Thread Tools

[RoR] problems using own class

 
 
Jonathan Heinen
Guest
Posts: n/a
 
      07-20-2006
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


 
Reply With Quote
 
 
 
 
Eric Hodel
Guest
Posts: n/a
 
      07-20-2006
On Jul 19, 2006, at 7:00 PM, Jonathan Heinen wrote:

> 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 <<?


Rails questions go on the Rails mailing list.

http://lists.rubyonrails.org/mailman/listinfo/rails

--
Eric Hodel - http://www.velocityreviews.com/forums/(E-Mail Removed) - http://blog.segment7.net
This implementation is HODEL-HASH-9600 compliant

http://trackmap.robotcoop.com



 
Reply With Quote
 
 
 
 
Jonathan Heinen
Guest
Posts: n/a
 
      07-20-2006
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


Jonathan Heinen schrieb:
> 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
>
>

 
Reply With Quote
 
Jan Friedrich
Guest
Posts: n/a
 
      07-20-2006
Jonathan Heinen wrote:
> I solved this problem with the help of a german RoR forum.

www.rubyforen.de is a german Ruby forum not (only) a RoR forum!
 
Reply With Quote
 
Jonathan Heinen
Guest
Posts: n/a
 
      07-21-2006
Hi Jan,

a little bit foolish but ...

Jan Friedrich schrieb:
> > I solved this problem with the help of a german RoR forum.

> 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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using own classloader inside J2EE to load and unload own classes. Stefan Siegl Java 1 07-02-2013 05:05 AM
Allowing access to my own computers within my own network =?Utf-8?B?VHJldm9y?= Wireless Networking 2 07-20-2006 09:05 PM
I have built my own (simple) thread manager [TM], but just found java 5 has its own. Saverio M. Java 0 07-03-2006 08:52 AM
Nested Class, Member Class, Inner Class, Local Class, Anonymous Class E11 Java 1 10-12-2005 03:34 PM
Your own photos in your own book Frank ess Digital Photography 1 12-09-2004 05:54 PM



Advertisments