# Globalize and render\_component: infinite loop?

**URL:** <https://www.ruby-forum.com/t/globalize-and-render-component-infinite-loop/68153>\
**Category:** Rails I18n\
**Created:** [September 9, 2006, 8:46pm UTC](https://www.ruby-forum.com/t/globalize-and-render-component-infinite-loop/68153 "2006-09-09T20:46:28Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sellittf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e99b99/32.png) [@sellittf](https://www.ruby-forum.com/u/sellittf)\
**Post date:** [September 9, 2006, 8:46pm UTC](https://www.ruby-forum.com/t/globalize-and-render-component-infinite-loop/68153/1 "2006-09-09T20:46:28Z")

</div>

Hi,

I just installed Globalize and I’m very excited about it!

Using it with the default

map.connect ‘:controller/:action/:id’

in config/routes.rb, there is no problem, but so far I set

map.connect ‘:locale/:controller/:action/:id’

to pass the language trough the URL, it seems to enter  
in an infine loop when I have a view with a render\_component() call.

For sure in both above cases, the Locale.set()  
is in app/controllers/application.rb.

Is it an already known bug?  
Is there a way around?

Thanks for hints

---

<div class="post-metadata">

**Author:** ![sellittf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e99b99/32.png) [@sellittf](https://www.ruby-forum.com/u/sellittf)\
**Post date:** [September 11, 2006, 11:07pm UTC](https://www.ruby-forum.com/t/globalize-and-render-component-infinite-loop/68153/2 "2006-09-11T23:07:45Z")

</div>

I found the problem.

It was something else in the application.rb.

Actually the

map.connect ‘:locale/:controller/:action/:id’

works very well.

Bye

PS: If you’re in the same problem, I’ll explain you how to prevent the  
loop.

---

<div class="post-metadata">

**Author:** ![sellittf](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/e99b99/32.png) [@sellittf](https://www.ruby-forum.com/u/sellittf)\
**Post date:** [May 26, 2008, 11:13pm UTC](https://www.ruby-forum.com/t/globalize-and-render-component-infinite-loop/68153/3 "2008-05-26T23:13:40Z")

</div>

Franco S. wrote:

> I found the problem.
> 
> It was something else in the application.rb.
> 
> Actually the
> 
> map.connect ‘:locale/:controller/:action/:id’
> 
> works very well.
> 
> Bye
> 
> PS: If you’re in the same problem, I’ll explain you how to prevent the  
> loop.

Hi,

I have the same problem with render\_component. Initialy, I jsut need to  
ad on the right side a list of tag for a weblog. So I would like to  
display a list of tag on every webpage (using the controller ‘tag’ and  
the action ‘listing’), even if the main controller of the current page  
is not ‘tag’. I don’t know if I can use a other way then  
render\_component to do so, but when I use it, I get a infinite loop…  
such as:

Processing CategoriesController#listing (for 127.0.0.1 at 2008-05-26  
21:45:16) [GET]  
Session ID:  
BAh7CDoMY3NyZl9pZCIlMTU2MDg2ZmUzZGIzOGRlM2VjZDViMTZhMWI2MDA0%0AZmIiCmFkbWluVCIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6%0AOkZsYXNoSGFzaHsABjoKQHVzZWR7AA%3D%3D–f08000449ccdeecc8ecd1e5c67f49baad76ebbcc  
Parameters: {“action”=\>“listing”, “id”=\>nil,  
“controller”=\>“categories”}  
Category Load (0.000652) SELECT \* FROM `categories`  
Rendering template within layouts/application  
Rendering categories/listing  
Category Columns (0.002227) SHOW FIELDS FROM `categories`  
Start rendering component ({:controller=\>“categories”, :layout=\>nil,  
:action=\>“listing”}):

Processing CategoriesController#listing (for 127.0.0.1 at 2008-05-26  
21:45:16) [GET]  
Session ID:  
BAh7CDoMY3NyZl9pZCIlMTU2MDg2ZmUzZGIzOGRlM2VjZDViMTZhMWI2MDA0%0AZmIiCmFkbWluVCIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6%0AOkZsYXNoSGFzaHsABjoKQHVzZWR7AA%3D%3D–f08000449ccdeecc8ecd1e5c67f49baad76ebbcc  
Parameters: {“action”=\>“listing”, “id”=\>nil,  
“controller”=\>“categories”}  
CACHE (0.000000) SELECT \* FROM `categories`  
Rendering template within layouts/application  
Rendering categories/listing  
Start rendering component ({:controller=\>“categories”, :layout=\>nil,  
:action=\>“listing”}):

Processing CategoriesController#listing (for 127.0.0.1 at 2008-05-26  
21:45:16) [GET]  
Session ID:  
BAh7CDoMY3NyZl9pZCIlMTU2MDg2ZmUzZGIzOGRlM2VjZDViMTZhMWI2MDA0%0AZmIiCmFkbWluVCIKZmxhc2hJQzonQWN0aW9uQ29udHJvbGxlcjo6Rmxhc2g6%0AOkZsYXNoSGFzaHsABjoKQHVzZWR7AA%3D%3D–f08000449ccdeecc8ecd1e5c67f49baad76ebbcc  
Parameters: {“action”=\>“listing”, “id”=\>nil,  
“controller”=\>“categories”}  
CACHE (0.000000) SELECT \* FROM `categories`  
Rendering template within layouts/application  
Rendering categories/listing  
Start rendering component ({:controller=\>“categories”, :layout=\>nil,  
:action=\>“listing”}):

Thanks for any help.
