# Complicated route

**URL:** <https://www.ruby-forum.com/t/complicated-route/180522>\
**Category:** Rails\
**Created:** [December 21, 2009, 6:16am UTC](https://www.ruby-forum.com/t/complicated-route/180522 "2009-12-21T06:16:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Abhishek\_shukla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7cd45c/32.png) [@Abhishek\_shukla](https://www.ruby-forum.com/u/Abhishek_shukla)\
**Post date:** [December 21, 2009, 6:16am UTC](https://www.ruby-forum.com/t/complicated-route/180522/1 "2009-12-21T06:16:27Z")

</div>

Hello Friends,  
I have a requirement where I want to have a dynamic url for e.g

[http://localhost:3000/company\_name](http://localhost:3000/company_name)

map.my\_company\_link’ ‘/:company\_link’,  
:controller =\> “companies”,  
:action =\> “show”,  
:requirements =\> {:company\_link’ =\> /[\w.]+/}

This works very fine.

But the complication is that now all request is going towards \*companies  
controller \*and _show action_, I know basically whats the problem Not  
not  
able to get the proper solution.

Please let me know if any one else faced the same issue.

Thanks  
Abhis

–

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 removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).

---

<div class="post-metadata">

**Author:** ![Abhishek\_shukla](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/a/7cd45c/32.png) [@Abhishek\_shukla](https://www.ruby-forum.com/u/Abhishek_shukla)\
**Post date:** [December 21, 2009, 6:22am UTC](https://www.ruby-forum.com/t/complicated-route/180522/2 "2009-12-21T06:22:53Z")

</div>

ok

map.connect ‘/:company\_link’,  
:controller =\> “companies”,  
:action =\> “show”,  
:requirements =\> {:company\_link’ =\> /[\w.]+/}

This worked for me 🙂

Thanks  
Abhis

On Mon, Dec 21, 2009 at 10:44 AM, Abhishek shukla  
[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)wrote:

> This works very fine.
> 
> But the complication is that now all request is going towards \*companies  
> controller \*and _show action_, I know basically whats the problem Not not  
> able to get the proper solution.
> 
> Please let me know if any one else faced the same issue.
> 
> Thanks  
> Abhis

–

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 removed\_email\_address@domain.invalid.  
To unsubscribe from this group, send email to  
removed\_email\_address@domain.invalid.  
For more options, visit this group at  
[http://groups.google.com/group/rubyonrails-talk?hl=en](http://groups.google.com/group/rubyonrails-talk?hl=en).
