Sunday, October 10, 2010

[Rails] Re: Problem with overriding URL helper methods

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate