On May 2, 11:18 pm, "Paul E. G. Lynch"
<plynch...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
wrote:> If I put a controller class into a gem, and then require that gem in
> my application, will the controller then be available to handle
> requests?
>
Well it can be done from a plugin, you just need to add the folder
containing your models to $LOAD_PATH, Dependencies.load_paths and
config.controller_paths (where config is the object in the initializer
block in environment.rb). My controller wasn''t rendering any views
(just json) but If you were you''d probably need to fiddle around with
view paths. With any luck you''ll be able to massage this into working
with a gem too.
Fred
--~--~---------~--~----~------------~-------~--~----~
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---