MonoRail redirect to # anchor

10 views
Skip to first unread message

Grootj

unread,
Feb 12, 2009, 7:31:42 AM2/12/09
to Castle Project Users
Hello,

I'm using Monorail with jQuery tabbed navigation (http://
docs.jquery.com/UI/Tabs).

When handling a controller action, I would like to redirect to a view,
and control which tab is visible. Therefore, I'd like to have my
controller redirecting to a specific anchor in a view, something along
the lines of:
RedirectToAction("Edit", "id=1", "#roles"));

Resulting in the url: http://localhost/MyApp/User/edit.rails?id=1#roles

However, the actual result encodes the # sign to
http://localhost/MyApp/User/edit.rails?id=1&%23roles=&

I'm surely missing a basic concept here. What do I need to do to solve
this?

Jimmy Shimizu

unread,
Feb 12, 2009, 8:11:44 AM2/12/09
to castle-pro...@googlegroups.com
I resorted to RedirectToUrl() since monorail doesn't seem to support
anchors/hashes, only querystrings.

This however doesn't work with routing.

Jason Meckley

unread,
Feb 12, 2009, 8:21:53 AM2/12/09
to Castle Project Users
what if you redirect to http://localhost/MyApp/User/edit.rails?id=1
and then
$(function() { set visible tab to [selected tab]; });
which would change to the appropriate tab once the page is ready.
Reply all
Reply to author
Forward
0 new messages