routing

Creating a rails route to an external URL

A lot of my users keep going to http://(rails app URL)/blog, but I don't actually have a blog. I finally setup a Posterous blog and now want to direct my users there. Is there a way to configure this using routes.rb? Is there a better way that doesn't involve editing the httpd.conf file? ...

Please recommend a open source orthogonal routing code such as LIBAVOID but in VB.net

It should be able to draw interconnection between two points in a Manhattan distance manner.It should also avoid overlapping other nodes and lines ...

ASP.NET MVC Using IDs in URLs

I know the default routes in MVC include an id param which often maps to the identity of an entity as it's stored in the database. Now, often this is OK, but what about when you don't want someone to be able to manipulate it? Quite frankly, on many business apps this is very common. For example, you don't want someone to change the accou...

How do I configure ASP.NET MVC routing to hide the controller name on a "home" page?

Following on from this question: ASP.NET MVC Routing with Default Controller I have a similar requirement where my end user doesn't want to see the controller name in the url for the landing or "home page" for their application. I have a controller called DeviceController which I want to be the "home page" controller. This control...

How to use routing helpers in a model with Rails 3?

Hello, In a model callback I make an API call and need to give the API some URLs. Those URLs would be easily generated by a routing helper. The solution given in this answer does not work anymore in Rails 3. Any solution? Thanks :) ...

How to rename the default REST routes in rails?

Before all, this question is about Rails 2.x. I live in a spanish language country and the URLs for my web apps should be in spanish. I always created spanish spelled actions for my controllers until now, but that just turn off many of the advantages for using REST, like the built-in PUT method => edit action stuff. So, I wanna know ho...

ASP.NET MVC 2 Parameter Array

Hi, I need to have the following routing logic: http://mydomain.com/myAction/{root}/{child1}/{child2}/... I don't know what is the depth of the route so I want the action's signature to look something like that: public ActionResult myAction(string[] hierarchy) { ... } Have no idea how to write that route. Help? Thanks a lot...

What's wrong with these asp.net mvc routing rules?

I have defined a series of Routes in Global.asax.cs: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute(null, "", // Only matches the empty URL (i.e. ~/) new { cont...

Is this a 'hack', and if so is there a better way to determine which ActionResult to return?

I have an A - Z directory 'widget' that I have on every page. If the user is on the home page and they click something in the directory, I want to load up the directory page with the corresponding result loaded. But if the user is on the directory page and they click something, I want to asynchronously load the result without doing a pag...

cakephp reverse routing conflicts with pagination logic

Hi, I've a new question :) I'll briefly explain what I'm trying to achieve. Right now I have an url that looks like this. /products/index/brand:figleaves I want this to look like this /brand/figleaves By writing the following route rule I get what I want. Router::connect('/brand/:brand/*', array('controller' => 'products', 'actio...

Can Apache Camel send a XMPP presence/pubsub packet to an XMPP endpoint?

I need to receive an update published to a JMS topic, convert it to a XMPP packet (Presence packet or PubSub packet) and route it to an XMPP endpoint. I am using ActiveMQ as JMS provider and Apache camel as routing engine. given below is my route in Camel (to make things simple I read from system.in instead of a jms topic): from("...

Rails RESTful routes and controller namespaces

I have a namespaced controller like this: class Shop::ProductsController < ApplicationController ... end I would like to route to this controller just as if it were not namespaced. ie. I would like to access this resource through the following URL: /products (ie. not /shop/products) How can I set up this route in routes.rb ...

Adding a route to a MKMapView

I'm trying to add a routing feature to an app I'm working on. I found Craig Spitzkoff's article on how to draw lines on an MKMapView which works pretty good. But since I don't have the coordinates of the points on the roads that doesn't help me as expected. Is there any way to determine the coordinates between to given points, say my cur...

Advanced Routing with Rails3

I want to use regular expressions inside my routes. I have an Products controller, but I want a different URL structure to access the products http://host/this/ http://host/that/ http://host/andthat/ These URLs should call a action in my controller (Products:show_category(:category)) Is something like this possible? match "(this|th...

ASP.NET 4 HttpHandler in Custom Route

I have made a custom Route which override GetRouteData. How can I know what type of request is being done? Everything passes the GetRoutData function (.css, .js, .axd, etc) and I would like to do something only if it is a System.Web.UI.Page. But httpContext.Request.CurrentHandler is always null because the routing takes place just befor...

asp.net mvc routing, ignore route with extension in the middle of url

Hi How can make the asp.net routing engine ignore routes with an extension of the type /pathtofile/filename.aspx/morepaths I know this is hardly a real scenario but I need to know for another similar issue for an autogenerated url Thanks ...

My route returns a blank view (no html when I do view source).

I am brand new to Ruby on Rails and I have been trying to get a simple default route set up and working. When I try to run my application I get a blank result (if I do a view source, there is nothing there). Here are the relevant files (not sure if I am missing something that would be useful). app/config/routes.rb Blog::Application.ro...

In ASP.NET MVC 2 - How do I get Route Values into my navigation controller so I can highlight the current link?

I'm trying to get the current Route into my navigation controller so I can run comparisons as the navigation menu data is populated. My Links object is like this: public class StreamNavLinks { public string Text { get; set; } public RouteValueDictionary RouteValues { get; set; } public bool IsSelected { get; set; } } In t...

Routing on local filesystem (for example on Server.MapPath)

I'm about to begin to use the asp.net module found at http://nathanaeljones.com/products/asp-net-image-resizer/ The module works like this: localhost/files/image.jpg.axd?width=400 (the module identifies this and resizes the image image.jpg). The problem is that I'm not just using images that is on my filesystem, I'm also using files th...

Ruby on Rails 3 routing error

Am working my way thru Ruby on Rails Tutorial: Learn Rails by Example and am on this page: http://railstutorial.org/chapters/static-pages#top Am getting problems when I create an HTML page in the public directory which is called public/hello.html and should appear as in Figure 3.3. My problem is that when I try to create the page an...