Hi!
On Mon, Sep 19, 2011 at 10:57 AM, slava wrote:

Hello,
I wonder how to tell my routes.rb to route requests to a resource to
it's parent controller
I don't know if what I will say is the "Rails Way", but maybe you can try:

1. Define in your config/routes.rb

resources :foos


2. Create a Controller that Inherits from Bar

class FoosController < BarsController

3. Reuse the methods you need calling super():

class FoosController < BarsController

def create
super()
end

end

Best Regards,

Everaldo


class Foo < Bar
end


resources :foos ===> controller :bars

--
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@googlegroups.com.
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.
--
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@googlegroups.com.
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.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 4 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedSep 19, '11 at 1:57p
activeSep 19, '11 at 10:50p
posts4
users4
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2021 Grokbase