On Wednesday, 5 February 2014 11:46:12 UTC-5, Ruby-Forum.com User wrote:
>
> According to this article Rails helpers from all controllers are 
> available to all views. But to me this looks kind of a dangerous 
> approach because I might at some point use helper methods with the same 
> name but with different implementations that can cause conflicts and 
> undesired results. This actually happened one time and it took me quite 
> some time to figure out the problem. 
>
> Why is the Rails helper scope this way? 
> What is the reason for sharing? 
> Does anyone had any problems with this approach? 
> Is there another recommended way to work? 
>
>
> http://strugglingwithruby.blogspot.com.br/2008/10/view-part-2-scope-helpers-and-partials.html
>  
>
>
Depends on who you ask - I'm of the opinion that if you have two functions 
with the same name but mixed into different controllers you've just made 
your code harder to navigate. At that point, the result of rendering a 
template is dependent on which controller is rendering it (since the 
controller picks which helpers are available).

--Matt Jones 

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-talk+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rubyonrails-talk/b05863f5-121d-41c6-925f-407d9d580e41%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to