I have created a plugin with a controller and views inside lib/app of the folder. I have added the controller''s folder to the LOAD_PATH, but not the views. When using the plugin, the controller is loaded, but not the view of the action. It always searches on RAILS_ROOT/app/views, not in my plugins folder. I have followed the Rails guides about how to create plugins, but it does not explain how to render views inside a plugin. Can anyone help? Should I put some code to user the plugin views? I''ll appreciate any help. -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Feb 18, 1:09 pm, John Smith <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I have created a plugin with a controller and views inside lib/app of > the folder. I have added the controller''s folder to the LOAD_PATH, but > not the views. When using the plugin, the controller is loaded, but not > the view of the action. It always searches on RAILS_ROOT/app/views, not > in my plugins folder. I have followed the Rails guides about how to > create plugins, but it does not explain how to render views inside a > plugin. Can anyone help? Should I put some code to user the plugin > views?What version of rails do you have ? In 2.3 the easiest way to do this is add a rails engine, in which case this should all just work, provided that the plugin has the correct directory structure (it needs to look a bit like an app ie controller in plugin/app/controllers, views in plugin/app/views Prior to that you have to do a bit more messing around - ActionController has a view_paths setting which controls where it searches for stuff. Fred> > I''ll appreciate any help. > -- > Posted viahttp://www.ruby-forum.com/.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.
Frederick Cheung wrote:> On Feb 18, 1:09�pm, John Smith <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> I have created a plugin with a controller and views inside lib/app of >> the folder. I have added the controller''s folder to the LOAD_PATH, but >> not the views. When using the plugin, the controller is loaded, but not >> the view of the action. It always searches on RAILS_ROOT/app/views, not >> in my plugins folder. I have followed the Rails guides about how to >> create plugins, but it does not explain how to render views inside a >> plugin. Can anyone help? Should I put some code to user the plugin >> views? > > What version of rails do you have ? In 2.3 the easiest way to do this > is add a rails engine, in which case this should all just work, > provided that the plugin has the correct directory structure (it needs > to look a bit like an app ie controller in plugin/app/controllers, > views in plugin/app/views > Prior to that you have to do a bit more messing around - > ActionController has a view_paths setting which controls where it > searches for stuff. > > FredOk. I''ll look for rails engines. Maybe with Rails 3.0 it''s different too. -- Posted via http://www.ruby-forum.com/. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@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.