routing

How to set up routes / link like this?

Take a look at haystack If you click on $3,000 and under take a look at the url it will be: "3000-under" Assuming you're using Search Logic how would this be done in the routes? For quick reference by default search logic suggests search[:params] which maps to a model field. For instance, Haystack's case: {:search => {:price_less_th...

Mod-Rewrite or PHP router?

I am debating routing my requests with one of the two options: Option 1: simple capture route with Mod-Rewrite and funnel written $_GET route to index.php for loading... #default routing RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^blog/([0-9]+)?$ index.php?rt=blog&params=$1 [L,QSA] // ....

best url for heirarchical data crud operations

I have 4 one-to-many relationships in a row so that each entity essentially has a parent entity. What is the best way to do this. Heres what i have so far? for the entities - Items -> Gallery -> Image -> Image Properties The url for items is easy item/list for the gallery though it could be item/gallery/1 for the gallery list o...

ASP.NET MVC Hierarchy Url Routing

Hello, I have a problem My route have an extra paramater after hierarchical category. /2009/World/Asia/08/12/bla-bla-bla asp.net mvc does not support this because my routing should be {year}/{*category}/{month}/{day}/{name} i tried use constraint like year = @"(\d{4})",category = @"((.+)/)+", month = @"(\d{2})", day = @"(...

Can I substitute MVC Routing for legacy WebForms URL Rewriting?

I'm currently migrating a large website from WebForms to MVC. It's going to be a long process, I can't go through every page and migrate it right away, nor do I want to. One of the issues I have is, in the old web app, we were doing some URL Rewriting for the WebForms stuff like so: from: http://sample.com/id/123/name/Something/Page.as...

How do popular routing gps/phones/mapping web sites update their route information?

How do popular routing gps/phones/mapping web sites update their route information? And do any phones send back data based on the users actual trip to allow the system to update route information? ...

ASP.NET MVC: Uri to usable route data

My problem is pretty simple. I've got a Uri and I want to figure out which route it maps to so I can do some checks on the various pieces of the route: controller, action, etc. How do I go from Uri to RouteData or Route? ...

RoR: View and Controller subdirectories?

I'm trying to use this technique (http://blog.hasmanythrough.com/2008/4/2/simple-pages) on "boiler-plate" pages I want to keep in a subdirectory of my controller's view folder. How would I do this? The below doesn't seem to work: returns a "Template missing" error. Error: Missing template home/New_York_apartments.erb in view path app...

rails routes question - how to take all parameters to end of URL?

Hi, In the rails config/routes.rb file, how do I ensure that the first route here takes all characters after the initial /site and uses this for this route (assigning it to :path). map.connect 'sites/:path', :controller => 'xxx', :action => 'yyy' map.connect ':controller/:action/:id' In other words how to avoid any URL that goe...

How do I unit test routes for web forms?

I have a web form such as mysite.com/list.aspx?state=florida&city=miami that I want users to browse using mysite.com/florida/miami/ and I'm using routing to do so. Then instead of using query string parameters, I end up having to use HttpContext.Current.Items[key] to retrieve the values on my list.aspx page. I have included the code be...

How to detect if rails is at the root url?

What I want is seems simple. In my application helper i setup this module ApplicationHelper def isroot if root_url @container = "mainbox" else @container = "maincontainerbox" end end end in my application layout i have this <div id="<%= isroot %>"> How do I find out if my application is at the homepage. if not do something els...

ASP .Net 4.0 Routing and Paging

Hi I refer to the following article, http://www.codeproject.com/KB/aspnet/paging%5Fwith%5Furl%5Frouting.aspx 1) Would like to know whether it avoids full fetch of data? To gain the performance as it mentioned in the stackover flow question here? http://stackoverflow.com/questions/1061574/custom-paging-or-standard-paging-in-asp-net-wh...

ASP.NET MVC - Generate Routes Without Http/Request Context

I'd like to be able to generate URLs from a RouteCollection without having access to the HttpContext. Looking at the way RouteCollection is implemented, all methods require access to a RequestContext in order to get the virtual path. I've worked around this by mocking the HttpContext but this adds an awkward dependency on RhinoMocks an...

Passing extra paramaters via route configuration in Kohana

Is there a mechanism to pass extra parameters to Controller actions in Kohana? Eg: $config['article/([0-9]+)'] = array('path' => 'news/show/$1', 'params' => array( 'param1' => 'some_stuff', )); The Kohana routing documentat...

Dynamically generate aspx pages based on xml content files and a master page

I want to develop a web application with a master page containing an <asp:Xml /> control for rendering xhtml content stored in xml files. I can do this easily enough by creating a WebContent aspx page per xml file, but what I want to know is how to go about developing a single request handler which will detect a request for a page e.g. ...

Binding and routing or url generation problem in Asp.NET Mvc application

In my view the call below generates url ending with Tasks/Edit but I want it to generate url like Tasks/Edit/23 <%= Html.ActionLink<TaskController>("Edit Task", (x) => x.Edit("23"))%> in Global.asax: string taskController = NameResolver.NameOfController<TaskController>(); string editAction = NameResolver.NameOfAction<TaskController>...

ASP.NET MVC routing based on data store values

How would you tackle this problem: I have data in my data store. Each item has information about: URL = an arbitrary number of first route segments that will be used with requests some item type = display will be related to this type (read on) title = used for example in navigation around my application etc. Since each item can ha...

MapQuest API: Any reason to use it over Google Maps?

So I've been looking into the different mapping API's out there, and I've narrowed it down to Google Maps API and MapQuest's API. I'm leaning towards the MapQuest API for: Unlimited queries Support for draggable routes. Google's API allows multiple way points, which is not the same thing. The draggable routes is a pretty important ...

Nested routing for models with double associations

In a toy Rails application, I'm modelling a situation where you have a number of pots, each containing an amount of something, and you can make transactions between the pots. A transaction can come from any pot, and go to any pot. Here are the relevant parts of the models: class Pot < ActiveRecord::Base has_many :to_transactions, :f...

ASP.Net MVC - HTTP Status Codes (i.e. 303, 401, 404, etc)

In ASP.Net MVC is it possible to use either Redirect or RecirectToAction to call for example a 303 error? I am working my way through a book titled "ASP.NET MVC 1.0 Website Programming" and the source is making calls such as return this.Redirect(303, FormsAuthentication.DefaultUrl); but this call only functions with an external library,...