Make a file "class_name.rb" and define your class(put it in the lib directory)
Then in the controller use <require 'class_name'> Instantiate it inside your controller and off you go =D 2012/2/7 M.SH <[email protected]> > Hello, > I am a beginner in rails and i want to create a class and access it > from the controller in rails > > thanks in advance > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

