routing

In Ruby on Rails, routes.rb, if map.something will create something_path and something_url, does map.connect create something like that too?

In Ruby on Rails, routes.rb, if we create a "named route" map.something ":a/:b", :controller => 'foobar' it will also create something_path and something_url which are two methods usable in the controller and in the view. Does map.connect create something like that too? Otherwise, isn't map.connect somewhat disadvantaged in this way?...

Setting up magic routes for plugins in CakePHP 1.3?

I'm working on upgrading my project from CakePHP 1.2 to 1.3. In the process, it seems that the "magic" routing for plugins by which a controller name (e.g.: "ForumsController") matching the plugin name (e.g.: "forums") no longer automatically routes to the root of the plugin URL (e.g.: "www.example.com/forums" pointing to plugin "forums...

Appending empty query string param to the URL in Rails

Is there a way to append something to the query string with no value set? I would like to see this kind of URL being generated: http://local/things?magic. What I'm looking for is when the user goes to http://local/other?magic then every URL in the generated page would contain magic in the end. Following code is almost a solution but i...

Routing configuration in cakephp

Hello all I am trying to implement routing in cakephp. I want the urls to mapped like this... www.example.com/nodes/main -> www.example.com/main www.example.com/nodes/about -> www.example.com/about So for this I wrote in my config/routes.php file.. Router::connect('/:action', array('controller' => 'nodes')); Now, I got the thing go...

ASP.NET MVC Map String Url To A Route Value Object

I am creating a modular ASP.NET MVC application using areas. In short, I have created a greedy route that captures all routes beginning with {application}/{*catchAll}. Here is the action: // get /application/index public ActionResult Index(string application, object catchAll) { // forward to partial request to return partial vi...

MVC Ajax.ActionLink doesn't find POST method

I have a POST method declared in my controller: [AcceptVerbs(HttpVerbs.Post)] public ActionResult UpdateComments(int id, string comments) { // ... } and an ActionLink in my view: <%= Ajax.ActionLink("update", "UpdateComments", new { id = Model.Id, comments = "test" }, new AjaxOpt...

setting up routing for the first time

I'm trying to set up url routing on my server for the first time. I'm fairly sure that mod_rewrite is enabled. Are there any other configurations I need to change or things to set up? Should the routing.yml file just automatically get read? ...

RESTful WCF Data Service Authentication

Hi, I'd like to implement a REST api to an existing ASP.NET MVC website. I've managed to set up WCF Data services so that I can browse my data, but now the question is how to handle authentication. Right now the data service is secured via the site's built in forms authentication, and that's ok when accessing the service from AJAX form...

WCF Endpoint routing

Hi, Guys, how to route inbound message between different endpoints. I need to expose the single endpoint that could accept different credentials. I guess, solve this by intercept the incoming message and based on message header then do forward message to appropriate endpoint. Thanks. ...

Adding custom :new routes using Rails 3 routing

In Rails 2 we can add custom new actions to resourceful routes, like: map.resources :users, :new => {:apply => :get} How do we achieve the same thing in Rails 3? resources :users do get :apply, :on => :new # does not work new do get :apply # also does not work end end Any ideas? ...

CakePHP Routing Problem

I suffered a CakePHP Route Problem. I can only access the root "/" and it shows the CakePHP default welcome home page. Later I try to write my controller (icons_controller.php) and views (views/icons/index.ctp), it has problem. I typed in http://localhost:8080/myapp/icons/ It always says "Not Found The requested URL /myapp/icons/ was not...

Ruby on Rails wildcard routing such as /foo.htm /foo.php /foo.something

I'm trying to create a routing situation where by default, any URL's such as this: /foo /something /foo.php /somethingelse.xml /something.something.else etc. will all route to one controller, assuming they don't route anywhere else. i can get this to work with the following code in my routes: map.myroute '/:file_or_folder', :con...

Zend Framework Route analog

This is a rails 3 code match '/articles(/:year(/:month(/:day)))' => 'posts#index'" that match url where some parts can be omitted to post controller and index action What is the most elegant way to make the same in Zend Framework ...

ASP.Net MVC Outbound Route Matching Problem When Using ActionLink

Hi there, Hoping for some help after reading into MVC routing and not coming up with the answer myself. I have the following routes registered: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( null, "YourFeedback/...

mod_rewrite - strange [R] behavior

Hello! I'm doing something very simple with mod_rewrite and it's behaving strange. It's behaving as if I'm using the [R] option, but I'm not. Here's a simple test for a .htaccess file: RewriteEngine on RewriteRule ^page1$ page2 This should redirect a request for page1 to page2, but leave the URL in the web browser still pointing to p...

FREE CAT! - URL routing relative paths with webforms ASP.net 4 and IIS6

Hi, I am try to get routing configured on an asp.net 4.0 site running on an IIS6 server. I am using MapPageRoute and it takes me to the correct page. Problems I have encountered so far: 1) Extensionless Url Routing Solved by installing QFE described here http://blogs.msdn.com/b/tmarq/archive/2010/04/01/asp-net-4-0-enables-routing-of-ex...

Rails 3 routes and modules

I have a AR model inside a module class Long::Module::Path::Model < ActiveRecord::Base end and want to use following routes (without the module names, because it's easier to write and remember) resources :models buts Rails 3 always wants to use a URL like long_module_path_model_url Is there are way to change this behavior? Hope...

Session is null in IRouteHandler.GetHttpHandler with Asp.net routing

Hi, I'm trying to get Session enabled in the GettHttpHandler method of my IRouteHandler classes but session is always null. Could someone tell me what I'm doing wrong? In global.asax I have RouteTable.Routes.Add("All", new Route("{*page}", new MyRouteHandler())); The MyRouteHandler class where Session is null looks like this: publi...

Human readable URL causes a problem in Ruby on Rails

I have a basic CRUD with "Company" model. To make the company name show up, I did def to_param name.parameterize end Then I accessed http://localhost:3000/companies/american-express which runs show action in the companies controller. Obviously this doesn't work because the show method is as following: def show @company = Company...

Adding waypoints to A* graph search

I have the ability to calculate the best route between a start and end point using A*. Right now, I am including waypoints between my start and end points by applying A* to the pairs in all permutations of my points. Example: I want to get from point 1 to point 4. Additionally, I want to pass through points 2 and 3. I calculate the pe...