if you want your class wired to a database table then you would create
the class in model directory.  The easiest
way to do this is to run the scaffold command which you can find in
the rails
documentation.

On Feb 7, 11:57 am, Benjamin Iandavid Rodriguez <[email protected]>
wrote:
> 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.

Reply via email to