routing

Adding collection routes to nested resources

I need to add some collection routes for a nested resource. I have a subscription controller and I need two new methods to add here. change_plan and update_plan Basically I need the urls looks like; http://localhost:3007/admin/accounts/1/subscriptions/7/change_plan http://localhost:3007/admin/accounts/1/subscriptions/7/update_plan So...

Is it possible to create a route like '~:id' in Rails 2.x?

I have been using the following route successfully in my Rails 2.x application: map.user ':id', :controller => 'users', :action => 'show' This, as my lowest route, properly catches things like /tsmango and renders Users#show. I'm now trying to add a second, similar route like: map.post '~:id', :controller => 'posts', :action => 'sho...

ASP.NET MVC 2 Routing with additional consistent parameters (not just controller & action)

Currently, I have URLs that look like this: http://www.example.com/user/create http://www.example.com/user/edit/1 But now, I have to support multiple organizations and their users. I need to have something like this: http://www.example.com/org-name/user/create http://www.example.com/org-name/user/edit/1 I was having trouble getting...

How to accept hash parameters in routes

Hi All, Query: I have a link like <%= link_to "link_name", :controller => "some_controller", :action => "some_action", :id => "some_id", :first_param => {:second_param => "some value"} %> and in my routes.rb map.connect '/some_name/:id' :controller => "some_controller", :action => "some_action" Above code is giving me a URL like ...

ASP.NET MVC - 404 Problem

Hi! I have a view folder structure: Views Admin Post New and routing is defined with: routes.MapRoute( "Admin", // Route name "Admin/{controller}/{action}/{id}", // URL with parameters new { controller = "Admin", action = "Index", id = UrlParameter.Optional } ); But, for ...

How to view a rails email from a url

As one tiny part of making authoring html emails less painful, I'd like to be able to view what I'm making without sending it to myself. This will also help later, with an "Email not displaying correctly? View it in your browser!" link. I'm working with Rails 3 (thus far ActionMailer 3.0 is a delight) and have an email model called "Not...

ASP.NET MVC2 and routing

I have the following route: routes.MapRoute( "edit_product", // Route name "Product/Edit/{productId}", // URL with parameters new { controller = "Product", action = "Edit", productId = UrlParameter.Optional } // Parameter defaults ); Why does this code works...

URL routing process works on one web, not another. 100% processor usage.

Hi, I thought I have URL routing under control as it works well on one website but found out it is not working fine on another. Both websites run from same server, same IIS 6.0, same asp_isapi.dll. SETUP 1: This one works well: routes.MapPageRoute("Article SEO", "sid/{sid}", ...

Alternative places to register routes to global.asax

It's most common practice to register routes in Application_Start event within global.asax.cs/vb file. But you need to have access to this file to do so. Fine. I either don't have or don't want to. I'm trying to integrate Asp.net MVC application into a Sharepoint 2010 site and don't want to create my custom global application class that...

Rails 2 Trailing Route Parameter

I'm building an article/blog website where any article may show up within a series of URL paths. /section/article /section/page/article /section/page/page2/article This works, but what if I wanted to have the page number for that article (/page/123) be bound to those URLs /section/article/page/123/ /section/page/article/page/123 /sec...

Rails 3 has_one routing

I have two classes: class User < ActiveRecord::Base :has_one :foo end class Foo < ActiveRecord::Base :belongs_to :user end The Foo is optional. I created the following routing: resources :users do resources :foo end Which results in the following routes: GET /users/:user_id/foo(.:format) {:controller=>"foo...

Symfony routing problem, route being ignored

I have the following in my app/frontend/config/routing.yml homepage: url: / param: { module: main, action: index } default_index: url: /:module param: { action: index } default: url: /:module/:action/* sf_guard_register: url: /register param: { module: user, action: register } sf_guard_signin: url: /login ...

rails: create a single table without id

I've just generated my first scaffold in rails. Now, I don't want my table to have a field named "id". Instead I want it to be named "uid" which will be an arbitrary string. But I can't seem to get my head around how this is to be done. Especially with managing routes. I've managed to set :id=>false and define "uid" as the primary key bu...

ASP.NET MVC - Routing Engine Appending Unexpected Values

I have a pair of routes that both point to the same action and depending on the supplied route data I would like one route to be chosen over the other. Trouble is, the routing engine seems to be automatically appending route values that I am explicitly telling it not to. routes.MapRoute( "Products_Search_Paged", "products/search/page{...

Rails3 custom route format

In routes.rb I was forced to add: post 'admin/user_update' to get my form_tag to work: form_tag( { :action => :update_user, :id => @user.id }, :remote => :true ) Now I get: Template is missing Missing template admin/update_user with {:handlers=>[:erb, :rjs, :builder, :rhtml, :rxml], :formats=>[:html], :locale=>[:en, :en]} in...

cakephp routing problem (or maybe just confusion)

Hi, I've just started learning cakephp and have gotten the Blog example working except for the routing, I'm still not quite sure how it works after reading many, many documents on routing (including the ones in the official cookbook). My problem is with the '/' root routing, I want it to go to the index() function of the PostsControlle...

How to create custom routes for certain actions in a CakePHP controller?

Coming from Django, I'm used to be able to organize my URL routings any way I see fit. For example, user registration would exist under the /users/ url. /users/ /users/registration/ /users/registration/optin/ /users/registration/thankyou/ However, I'm creating a user registration system in CakePHP and the default convention behaviour...

ASP.NET MVC - Help defining route entry

i want to build a route entry for a url http://example.com/foo which should map to Index(string foo) action method of a controller named User. At the same time the default Home Controller should not be affected and should work normally any help is greatly appreciated Thanks ...

How to send jQuery $.get so the Model Binder can bind a string to a parameter?

I'm having difficulty getting the Model Binder to work. I thought it was the jQuery, so I asked this question, but after further investigation, I can see that the jQuery is indeed sending the parameter to the server. That's the reason I'm asking a new question - this is no longer a jQuery issue, as I originally thought. Background: Wha...

multiple prefix routing in cakePHP

Hello friendz, I have a new project with 4 users and some tasks which is only allowed to certain users. Since the users and tasks are fixed i thought no need of using ACL. is my decision is correct?? Then can i have multiple prefix for each users if yes how can i achive it?? I need to restrict the task of user A from user B how ...