routing

How to handle 404's with Regex-based routing?

Please consider the following very rudimentary "controllers" (functions in this case, for simplicity): function Index() { var_dump(__FUNCTION__); // show the "Index" page } function Send($n) { var_dump(__FUNCTION__, func_get_args()); // placeholder controller } function Receive($n) { var_dump(__FUNCTION__, func_get_args())...

ASP.NET MVC 2 - How to ignore an entire directory using IgnoreRoute?

I've tried the following two methods to try and ignore my "Assets" folder, but I keep coming up with errors. Can anyone tell me exactly how the Ignore Regex is supposed to look? routes.IgnoreRoute("/Assets/") routes.IgnoreRoute("{*assets}", New With {.assets = "\/Assets\/(.*)"}) ...

CakePHP Best Practice: Admin with or without routing

I'm working on an overhaul of a CakePHP app I built under CakePHP 1.2. I've upgraded to 1.3 and am considering moving away from the admin routing paradigm for my application. I'm finding that some of my controllers are getting extremely large because of duplicate functions for front end and admin. My intuition is that it is much clean...

Dynamic URL Routing w/ Web Forms

I have posted in here before but all have led to dead ends. First of all I got this to work via ASP 4.0 with MapPageRoute. But in 3.5 I apparently don't have that option. I want to accomplish the following: destination.aspx?id=1 -> destinations/rome destination.aspx?id=5 -> destinations/florida Below is the code I currently have: <%...

Routes configuration for named arguments in CakePHP

Hi, In my Cake application I have a controller "completed_projects". Its index action takes no arguments and lists some projects. Different pages can be accessed by example.com/completed_projects/index/page:23 etc. I want to make the url's like this: example.com/portfolio/page23 Obviously I need to make some routes for this. I've tri...

cakePHP routing help

Hello folks, Here I am trying to route a page without showing its action in URL, Eg: URL is http://localhost/brands/1/xyz Router::connect( '/brands/:id/:name', array( 'controller' => 'brands', 'action' => 'index', 'id' => '[0-9]{1,}', 'name' => '[a-z]{1,}' ) ); it works fine.... But I nee...

Route to nested model/form for unsaved parent

I have a complex form for a model Schedule that belongs to a parent Listing model: class Listing < ActiveRecord::Base has_many :schedules, :dependent => :destroy accepts_nested_attributes_for :schedules, :allow_destroy => true, :reject_if => :all_blank ... end class Schedule < ActiveRecord::Base belongs_to :listing ... end ...

Determine if path exists as route in Rails controller

I want to know if an arbitrary path can be mapped to a route recognized_request_for accomplishes what I want, but I can't get it to work in my controller. Specifically, how can I execute recognized_request_for or something that accomplishes the same task from my controller? ...

Strange Rails 2 Routing Question

I saw this in a rails 2 vs 3 comparison pdf lecture and I'm not sure what's going on with the preview and archived flags. post.resources :comments, :member => { :preview => :post }, :collection => { :archived => :get } Any ideas? ...

Content-based routing with RabbitMQ and Python

Is it possible with RabbitMQ and Python to do content-based routing? The AMQP standard and RabbitMQ claims to support content-based routing, but are there any libraries for Python which support specifying content-based bindings etc.? The library I am currently using (py-amqplib http://barryp.org/software/py-amqplib/) seems to only supp...

Ruby on Rails named routes with absolute path from application root

I'm trying to set up named routes for page: www.myhost.com/blog/about (map.about '/about', :controller => 'page', :action => 'about') And I have another route for a resource: www.myhost.com/blog/post/3 (map.resources :posts) Now I don't know how should I link to "about" page. If I use a) <%= link_to 'About', about_url %> or ...

Rails3 nested-routing issues

I would like to create a mechanism for a User to keep track of other, favorite Users, similar to SO's favorite questions. I'm using the Rails 3.0 beta. To do so, I have a User-Favorite HABTM relationship, which works as expected: class User < ActiveRecord::Base has_and_belongs_to_many :favorites, :class_name => "User", :join_table =...

WCF - Routing Issue

I am working on a WCF REST service, and in the service I have two methods with the same URITemplate. One of them is marked with a WebGet and the other with a WebInvoke using PUT as the method. [WebGet(URITemplate="{name}")] public Something GetSomethingNamed(string name) [WebInvoke(Method="PUT", URITemplate="{name}")] public Something...

ASP.NET MVC Routing not Working in Virtual Directory

I have an asp.net mvc 2 app (using .net 4.0) that isn't routing correctly when hosted in a virtual directory. I have the following simple routing rule: routes.MapRoute( "Default", // Route name "{action}", // URL with parameters new { controller = "accounts" } // Parameter defaults ); ...

Why the CodeIgniter 2 does not support the Modular Extensions?

After I was upggrading the CI 1.7 with Codeigniter 2 returns an Error and it shows as a routing error, its because of CodeIgniter 2 Routing library has little optimized. how to resolve this problem? ...

Passing data from a form through a query string in Rails

I am creating an application with a search feature, and I would like have it set up similarly to Google or Twitter search, where there is a landing page with a search form at the root URL and then data from this form is passed through a query string, which forms the URL for the results page (for example: www.domain.com/search?query=my+se...

ASP.NET MVC 2.0 Simple Routing Question

Im in the process of moving our website from a crappy CMS over to a nice custom coded MVC website. Everything has gone smoothly so far but I'm having some issues with routing. Our company sends out a lot of marketing emails and letters. In these we have the user go to Landing Pages so we can track how campaigns are doing, as well as o...

Ruby on Rails route based on self join

I have a self join through an intersect table in an app I'm working on like below. class User < ActiveRecord::Base has_many :clients, :through => :client_relationships, :conditions => "approved='1'", :source=>:user end It's working in the sense that I can say @current_user.clients and get all of the clients. However, I'd like to s...

Rerouting all ASP.NET pages

I am looking to rewrite all ASP.NET pages to a uniform structure. Something like: /Content1/Page1.aspx -> /Page1 /Content1/Page2.aspx -> /Page2 /Content2/Page3.aspx -> /Page3 (note different sub-dir) /xyz/Page4.aspx -> /Page4 Is this possible? URL Rewriting seems interesting... Will it also comply with my web.config secur...

Is it i possible to prevent certain PartialViews from being served if requested directly?

I'm working on a site that has routes to actions which render Partial Views. A lot of these partial views are components which together make up a complete page. For instance on a search page I'm working on has a text box, a list of tabs, and a Table. Seach of these can be accessed with a URL similar to /Search/SearchPanel /Search/Tab...