# Keeping format in link\_to

**URL:** <https://www.ruby-forum.com/t/keeping-format-in-link-to/175854>\
**Category:** Rails\
**Created:** [September 21, 2009, 4:18pm UTC](https://www.ruby-forum.com/t/keeping-format-in-link-to/175854 "2009-09-21T16:18:45Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bobm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9fc348/32.png) [@bobm](https://www.ruby-forum.com/u/bobm)\
**Post date:** [September 21, 2009, 4:18pm UTC](https://www.ruby-forum.com/t/keeping-format-in-link-to/175854/1 "2009-09-21T16:18:45Z")

</div>

Hello, if a action/id.something is called with the link\_to urls don’t  
keep the format ? I mean the link\_to calls inside the view don’t  
maintain the .something and generate unformatted links

How can I do to keep the format ?

---

<div class="post-metadata">

**Author:** ![bobm](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/9fc348/32.png) [@bobm](https://www.ruby-forum.com/u/bobm)\
**Post date:** [September 21, 2009, 6:19pm UTC](https://www.ruby-forum.com/t/keeping-format-in-link-to/175854/2 "2009-09-21T18:19:15Z")

</div>

How about posting the actual link\_to so we know what you are trying to  
accomplish…

If I do link\_to “xml”, resource\_url(:format =\> :xml) that gives me /  
resource.xml in rails 2.3.4 if thats what you want.

On Sep 21, 7:18 am, Bob M. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
