routing

ASP.NET MVC2 Routing / Folder structure

In ASP.NET MVC2, How do I change routing/folder structure so I can have Views\FOLDER\Account\ChangePass.aspx Rather than: Views\Account\ChangePass.aspx I don't actually want to do it for the account, but I'd like to structure things like that, e.g. SO I can have two different views like: Views\Categories\ Views\Admin\Categori...

Symfony: How to access the user object early in execution

Hi, I have a custom routing class that checks versioning of an object to allow for creation of draft versions of pages that wont appear on the live site. When an admin clicks to preview a draft version of a page my PublishingHelper class on the front-end (called from the routing class) checks the user's permissions to see if they are al...

CakePHP: pagination and custom routes

I don't seem to be able to use a custom route with pagination. The URL of the blog should be http://www.domain.com/en/page:2. However, the links generated by the PaginateHelper (prev and next), keep adding the controller and action, so that the URL looks like http://www.domain.com/posts/index/en/page:2. The route config is quite simple...

Can i have multiple methods (post and get) allowed on an index action?

i would like an index action to be able to take get and post methods, is this possible and if so how? how do you write the route if in this case map.resources :content, :only => [ :index ] Many thanks ...

Constructing URL parameters in Rails 3

I am trying to use the following code to convert a hash of options (e.g. { :opt1 => 'a', :opt2 => 'b' } ) into parameters to be appended to a URL (e.g. example.com/page?opt1=a&opt2=b): ActionController::Routing::Route.new.build_query_string(options) where options is the hash. I get the following error: wrong number of arguments (0 fo...

Routing goes nuts on asp .net mvc 2 application that is the same app set up 2x on the same server.

This is going to sound quite bizarre. I have one ASP .NET MVC 2 application. Works great. Routing is not very complicated. I am running this on windows 2003 IIS 6, so I have to use the {controller}.aspx routing configuration. Anyhow, I've set the same MVC 2 application up twice under different virtual directories on IIS. This is litera...

What is causing this redirect_to to fail?

I am trying to use this redirect_to redirect_to :controller => :note_categories, :action => :destroy, :note_id => params[:id] This is the URL that results http://localhost:3000/note_categories/272?note_id=272 and this is the error message Unknown action No action responded to show. Actions: destroy The reason I am redirecting to...

Array of proxies on a linux machine

Hi, I would like to setup a system which I could change the ip any time I want. The Idea I have is to have a list of proxies, which by pressing a button or something similar will switch to a different proxy server. any suggestions of how to do it( I believe there is already a software for that somewhere) I use ubuntu 10.04 (linux). ...

What does "map.resource" in the route file do exactly?

Take the most simple example: map.resource:account 1) How different is it from defining all the names routes - like: :map.new_account "new_account", :controller=>"activity", :action=>"new" 2) How do you set an additional route within the resource definition? For example, say there is one more method for the resource :map.b...

ASP.NET-4.0 WebForms post Routing event

How can you hook on to an event that gets fired directly after the Routing / mapping is done? I want to perform some actions directly after the Routing is done and the mapped URL is available. I tried PreRequestHandlerExecute, but that event is fired just before the Routing takes place. I can't find any other place. PostRequestHandlerEx...

CakePHP routing with colon seperator

I need to create routes that include a colon to produce URLs like http://app.com/prjct:a9b5c. Obviously it's currently simple to use a slash instead with the default routing. $SLUG = array('slug' => '[-_A-Za-z0-9]+'); Router::connect('/prjct/:slug', array('controller' => 'projects', 'action' => 'show'), $SLUG); But routes specificatio...

URL Routing,,,,I need a workaround

Hi,i found something that is not smart done in the URL routing of .net 4.0 and i need a workaround to make it works my scenario is the following,,i call this method on the application start event handler in global.asax void RegisterRoutes(System.Web.Routing.RouteCollection routes) { routes.MapPageRoute("ViewEntities","{CompanyU...

how to make new url in rails routing

I have model/controller called notification. I want to make a new url so that I can access it by: /notifications/my_new_url?id=4 and have that page go to view my_new_url.html.erb however, it always keeps going to show method: This is in my routes.rb map.resources :notifications map.connect 'notifications/get', :co...

Rails 2.3.8: namespace + default route (server-dependent routing issue)

Hello! I have FriendshipRequests controller under controllers/users/ namespace. The problem appeared after setting up stage server: same url is processed different locally and on the stage. locally (mac os X, ruby 1.8.7p174, frozen rails 2.3.8, rack 1.1.0) /users/friendship_requests/accept?req_id=3 routes to Processing Users::Frien...

Add slashes in Area name on an ASP.NET MVC 2 route

Currently I have an Area in my ASP.NET MVC 2 project call 'API', which is self explanatory. As the API of my web application matures, I will soon need to add version numbers to my address. ie/ Instead of : http://site/API/ I will need http://site/API/1.0/ http://site/API/1.1/ ... What's the best practise to achieve this in ASP.NE...

.NET MVC2 custom subpage routes

In searching I came across http://stackoverflow.com/questions/411054/asp-net-mvc-page-subpage-routing and the wildcard was somewhat of a lifesaver, but presented a new problem. Consider the following routes, if you will. The goal here is to have the index (http://www.domain.com) use the default route and [domain]/page use the Content ro...

Understing URL routing in MVC

I am trying to create a very basic MVC framework to better understand the pattern. I am having trouble understanding the URL routing part. So far i've understood that the url carries 3 basic pieces of information in this format: www.site.com/controller/method/querystring So given the following URL: www.site.com/user/delete/john 'user...

Rails, same view, different controllers

map.resources :persons map.resources :people class Persons_controller < ApplicationController::Base #the whole logic for the controller end class People_controller < PersonsController #nothing special there end How I can use the views from /app/views/persons/ when I access my app from http://mydomain.com/people/1 ? I get an err...

Why do my Rails 2 routes have query strings?

I sometimes need to pass additional parameters to a page via the URL. I did this in the past with a couple of generic placeholders in the routes file, which I call "genus" and "species". This used to work, but now it has started producing URLs with query strings. The Rails version is 2.3.8. The routes file is: ActionController::Routin...

Cakephp Route Top Level Request

Hi - I have a 1.2 app that I'm updating to 1.3. I need to send all top level requests like /foo to a controller action (/sites/view/$1) if they are not a valid controller. So in my 1.2 app I had a route like this (incredibly ugly I know): Router::connect('(?!admin|billings|carriers|clips|cliptypes|contacts|domains|faqs|leadcomments|...