extending controllers

eben
Sun, 30 Sep 2007 17:06:13 -0000

I''m fairly new to RoR, so apologies in advance if I rape the
terminology here...

I am trying to use functionality from one controller in another
controller.  Here is the first controller:

class PagesController < ApplicationController

   def show
       @page = Page.find(params[:id])
   end

end

2nd controller

class SiteController < ApplicationController
   def some_page
      @page = Page.find(:all, :conditions => "name =
''some_page''")
   end
end

Ultiamtely, I''m trying to access my "Pages" table from a
controller
other than the Pages controller... not sure if I have to extend the
new controller or how the functionality "trickles down" to my new
controller?

Any advice is appreciated