Luis Saffie wrote:
> Olivier Lance wrote:
>> Luis Saffie wrote:
>>> Looks like nested routes would be a better approach for this
>>> 
>>> You'd need
>>> map.resources :owner, :has_many => diagrams
>>> 
>>> This would create this type of restful
>>> route owner_diagrams_path
>>> route_owner_diagram_path(@owner, @diagram)
>>> etc
>>> Once you have the route.rb file in place, you can run rake routes from 
>>> rails_root to see all available routes
>> 
>> Thanks for your reply!
>> I'll certainly try going this way... however, do you have any idea about 
>> this overriding thing? I'd like to understand why my views can use my 
>> overriden methods but not my controllers... :\
> 
> Helpers are made for views and not controllers. However, you can still 
> use them in your controller. Not sure whats up in your case but you can 
> do a quick google search for rails using helpers in controllers

I partly agree with that... Helpers are made for views indeed, but who's 
ever been doing a controller without any URL helper?
That's maybe why my overridden ones aren't in my controllers, maybe 
they're not Helpers as other view helpers? I'll try to figure that 
out...

Another thing now... I'm using acts_as_commentable and I have a comments 
controller that can create a comment and associate it to any commendable 
model.
I'm using polymorphic_path to redirect to the model show page once the 
comment is added. How can I still do this with a nested route, which 
will require owner plus model's id, when any other model pah would just 
require the model's id?!
(that's why I came to the override at first)

Thanks again!
Olivier

-- 
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 [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