# %F2 in URLs after upgrade

**URL:** <https://www.ruby-forum.com/t/f2-in-urls-after-upgrade/145889>\
**Category:** Rails\
**Created:** [August 14, 2008, 7:28pm UTC](https://www.ruby-forum.com/t/f2-in-urls-after-upgrade/145889 "2008-08-14T19:28:25Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@tom](https://www.ruby-forum.com/u/tom)\
**Post date:** [August 14, 2008, 7:28pm UTC](https://www.ruby-forum.com/t/f2-in-urls-after-upgrade/145889/1 "2008-08-14T19:28:25Z")

</div>

Hi All,

I recently upgraded a rails app to 2.0.2 and I’m having an issue when  
I build URLs to edit specific items. It seems I’m getting %2F instead  
of the slash and this causes the controller to not recognize the  
action. Here’s some code from an RHTML file:

## Please select the specific resource

## Region: \<%= @region %\>
\<% for resource in @all\_resources %\> \<% if @region == resource.region.Name %\> 
#### \<%= nav\_link "#{resource.Name}", "Admin", "skills/ #{resource.id}" %\>
 \<% end %\>

\<%end %\>

Instead of /admin/skills/84 I get /admin/skills%F284

which then gives me this:

Unknown action  
No action responded to skills/84

There must have been a change in the upgrade but I can’t find anything  
after lots of searching.

Thanks,

Tom

---

<div class="post-metadata">

**Author:** ![tom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@tom](https://www.ruby-forum.com/u/tom)\
**Post date:** [August 14, 2008, 7:43pm UTC](https://www.ruby-forum.com/t/f2-in-urls-after-upgrade/145889/2 "2008-08-14T19:43:06Z")

</div>

Not quite sure what the method nav\_link is, some helper you defined  
yourself? Makes it difficult without the source of that method to see  
how your URL is constructed. Try to see if \<%= link\_to  
“#{resource.Name}”, 'admin/skills/#{resource.id}" %\> works first.

---

<div class="post-metadata">

**Author:** ![tom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@tom](https://www.ruby-forum.com/u/tom)\
**Post date:** [August 14, 2008, 8:08pm UTC](https://www.ruby-forum.com/t/f2-in-urls-after-upgrade/145889/3 "2008-08-14T20:08:56Z")

</div>

Sorry about that. It’s a helper function from the RailsSpace book:

# Return a link for use in layout navigation.

def nav\_link(text, controller, action=“index”)  
link\_to\_unless\_current text, :controller =\> controller,  
:action =\> action  
end

---

<div class="post-metadata">

**Author:** ![tom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@tom](https://www.ruby-forum.com/u/tom)\
**Post date:** [August 14, 2008, 8:37pm UTC](https://www.ruby-forum.com/t/f2-in-urls-after-upgrade/145889/4 "2008-08-14T20:37:06Z")

</div>

Thanks for responses! I’ve got it under control now and see the err of  
my ways.

---

<div class="post-metadata">

**Author:** ![tom](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/3d9bf3/32.png) [@tom](https://www.ruby-forum.com/u/tom)\
**Post date:** [August 14, 2008, 8:28pm UTC](https://www.ruby-forum.com/t/f2-in-urls-after-upgrade/145889/5 "2008-08-14T20:28:54Z")

</div>

On Aug 14, 8:08 pm, Tom [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Sorry about that. It’s a helper function from the RailsSpace book:
> 
> # Return a link for use in layout navigation.
> 
> def nav\_link(text, controller, action=“index”)  
> link\_to\_unless\_current text, :controller =\> controller,  
> :action =\> action  
> end

You can’t do it like that. If call call nav\_link(“foo”, “bar”, “edit/  
1234”) then it will think that the action name is “edit/1234”, and  
escape that like a single entity. You will want to pass ‘:id =\> 1234’  
to link\_to\_unless\_current.
