Questions tagged [custom-routes]
198 questions
1
vote
1 answer
MVC 4: Custom Routes
I see a lot of problems with MVC routes and I'm having a similar problem getting a route to match a URL.
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
//default route
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
…

Jay
- 43
- 1
- 5
1
vote
1 answer
Rails routes inside resources :blah do
So far my routes.rb file looks something like this:
resources :games do
resources :planets do
member do
get 'index' as: :play_game
end
end
end
which creates these (when I check rake routes)
play_game_game_planet GET …

Tom Prats
- 7,364
- 9
- 47
- 77
1
vote
2 answers
RHQ/JON agent configuration for camel route monitoring
I have written custom plugin for monitoring camel routes on Jboss Operational Network(JON).
But in RHQ server/JON no metrics is being added for monitoring.
In RHQ-agent log file I am able to see the following.
2012-12-04 13:47:13,515 DEBUG…

user1852586
- 41
- 4
1
vote
0 answers
ASP.NET MVC - Creating a custom Uri to Route mapping handler
I'm looking to heavily customize the way my application handles Routes. Essentially, I want to achieve a process something like this:
User requests URL: /custom-url-part-1/custom-url-part-2/gallery/1/date
Application looks for a match in a database…

Liggi
- 744
- 8
- 22
1
vote
1 answer
rails routes optional parameters types by :id or :name
Scenario:
I would like to have a url path where you could look someone up by an :id or :name:.
For user/5 or /user/tom would all point to the same user
routes.rb
controller 'user' do
get 'user/:id'
get 'user/:name'
end…

alenm
- 1,013
- 3
- 15
- 34
1
vote
1 answer
MVC 3 Routes: Dynamic content from home controller - Where am I going wrong?
My Setup
I have a set of controllers in the normal fashion, which have their usual CRUD action methods inside them. Examples of these controllers are Testimonials, Galleries, and FAQs. These have backing models in Entity Framework, such as…

Hoecuspocus
- 192
- 3
- 11
1
vote
1 answer
Ruby on Rails - Setting a Custom Route with Custom Action
i'm a RoR beginner using rails 3.2.3.
I have a products resource and a nested Availability resource under it.
My routes are:
/products/:product_id/availabilities
which is working great.
However, my availability model allows to set the price of the…

Silver
- 693
- 1
- 10
- 27
1
vote
2 answers
CakePHP create route used only if all other routes fail
I am using a PagesController (not the same that Cake has built in) and I would like to connect a new route:
Router::connect('/*', array('controller' => 'pages', 'action' => 'view'));
I really want Cake to ONLY use this route if all other (default)…

Evert
- 2,022
- 1
- 20
- 29
1
vote
1 answer
Are deeply nested polymorphic resources worth the effort?
I am at the point in my development that I am thinking that deeply (>1) nested resources are not worth the effort.
I have something like this:
resources :first-level do
resources :comments
resources :second-level do
resources…

Dan Tappin
- 2,692
- 3
- 37
- 77
1
vote
1 answer
hypen in MVC 3 routes
Here is my desired url format: /product-24-hid-35wh4-cx-dsgtx
How can I map this URL to my action method:
public ActionResult Product(int id)
Here is my routing code:
routes.MapRoute(
"ProductDetail",
"product-{id}-{name}",
…

dfang
- 1,366
- 15
- 41
1
vote
1 answer
Cakephp routes for multilingual cms
I'm trying to create a Route in Cakephp that can have anything as a prefix. But I also want the admin route to work properly.
The prefix would in this case be a language. The Route has to link to a controller named front with action: index.
A url…

waterschaats
- 994
- 3
- 18
- 32
0
votes
1 answer
Track another URL ruby on rails 3 routes
I'm trying to mapping my application to a different URL, the default is "/", i'm trying to send all pages to "/application_home" how can i do this configuring the routes file?
Thanks in advance!

guisantogui
- 4,017
- 9
- 49
- 93
0
votes
2 answers
NameError in my_foos#index undefined local variable or method 'foo_bar_my_foos_path'
I'm having a problem with understanding how RESTFUL resources works in Rails 3. If I have in my rails routes.rb file:
resources :my_foos do
member do
get 'foo_bar'
end
end
I have a controller file my_foos_controller.rb
class…

Ray Wong
- 1
0
votes
1 answer
cakePHP 2.0 routes when controller not existing
When a Controller or Plugin isn't found. I want it to end up at a specific controller that examines the ulr(db), and checks if there's a page related to it in my cms.
So, after the default cakephp routing I don't want the missing
controller error…

waterschaats
- 994
- 3
- 18
- 32
0
votes
1 answer
Named route for added action is not recognized
Ok, I need help with this one. I have defined a resource with non-standard actions. It looks like this in config/routes.rb:
1 Upload::Application.routes.draw do
2
3 resources :lib_imports, :only => [:index, :new, :create, :show] do
4 get…

Mike E
- 5,493
- 1
- 14
- 15