routes

DRY - Question about paths and urls from a string or model object

I know how to get paths and urls no problem (eg. new_color_path for the Model Color) but what if I am trying to create a partial that can be used for multiple models and I still nee the "new_***_path" or one of the others? Is it possible to generate the url from a model object? ...

Uninitialized constant problem for Rails routes

Here's my route configuration: map.resources :services do |services| services.resources :capabilities do |capabilities| capabilities.resources :http_headers end end Here's my "rake routes" output: laran:trunk laran$ rake routes (in /Users/laran/workspace/kibo/mega/server/trunk) accounts GET /accou...

Simplest way to define a route that returns a 404.

Hi, I've got a requirement to specify a named route in a Ruby on Rails project that returns the public/404.html page along with the 404 server response code. Leaving it blank is not an option, please don't question why, it just is :) It absolutely must be a named route, or a map.connect entry would do. Something like this would be g...

Rails Nested Route For Singular Resource

I have a nested route on a singular resource map.resource :account, :controller => "users" do |page| page.resources :feeds end I'm trying to make a form to add a feed. I start with this... <% form_for @feed do |f| %> undefined method `feeds_path' for #<ActionView::Base:0x2123174> So I try <% form_for [current_user,@feed] do |f|...

Access to Tomcat from remote PC

Hi, I've developed a web application using servlet and tomcat. When I try to use this application from the server everything is rigth (i.e. http://localhost:8080/app_name/init.html). However I'm having a hard time trying to access to this application from another PC. The server PC and client PC are connected using a router, there are n...

Custom routes in Rails

Hi! I'm trying to create some nice links over my website. I'm creating a search via tags just now, and I wonder if it is possible to create some nice routes like this: http://myapp.com/search/a_very http://myapp.com/search/nice_set http://myapp.com/search/of_tags or at least like this: http://myapp.com/articles/search/a_very http://m...

ASP.NET MVC - Strange routing issue, very simple route mismatch problem

I'm at a loss... here's my route: routes.MapRoute("LangOnly", "{language}", new { controller = "Home", action = "Root", language = "en" }, new { language = @"en|ja" }); it matches www.domain.com/en, but does not match www.domain.com/ja. huh? I've even gone so far as to comment out any other routes... kind of stuck. ;/ Update...

ASP.Net MVC: Form with Get Method Losing Parameters on Submit

Say I have a route like this: "{controller}/{action}/{roomId}/{name}" And a form action like this (And yes it looks like this in the action in the html ie post server processing): Room/Index/6/SomeThing?pageNumber=1&amountToShow=5 And the form is simple: <form action = "Room/Index/6/SomeThing?pageNumber=1&amountToShow=5" method="g...

IIS - ASP.NET MVC redirection

Hello, I have two applications using ASP.NET MVC, each with multiple controllers. I want to do a redirect from application A to application B, but only for a single route on application A (one controller). Eg. /applicationA/issue/* should redirect to /applicationB/issue/ /applicationA/quality/ should not redirect The examples for I...

Can I map new routes to the RouteCollection outside Global.asax?

I'd like to occasionally map new routes to the RouteCollection during program execution long after the Global.asax RegisterRoutes() method had first executed. How can I do this? ...

Add default value into prefix to my routes generated by the *_path methods

I have added into my routes file prefix value to each map.resources line. So it all looks like this: map.resources :subjects, :path_prefix => ':company' I have even added this line for default behavior map.connect ':company/:controller/:action/:id' which is not necessary (I believe) because all the routes are handled with resource...

Why, when I register my routes in an MVC test is NUnit sharing this across tests?

I am testing my routes in an mvc app. I have the following code: using System.Web.Routing; using MvcContrib.TestHelper; using NUnit.Framework; using web; using web.Controllers; namespace tests.web.Routes { [TestFixture] public class routeTests { [Test] public void Route_POSURL_MapsToPOSIndex() { ...

Changing default REST actions in rails

I want to be able to change the default mapping of actions with RESTful url and type of request. For example, After adding map.resources :fruits in the routes, by default, sending a GET request to /fruits/:id calls show action in fruits controller. However, I would like to call a custom action, say display, in the fruits controller in...

Rewrite Route to map to default route

Hi! Because of the problems I experienced here: Zend_ Controller_ Router_Exception: “xyz” is not specified I want to have this route: ":module/:controller/:id" and map it onto this: ":module/:controller/:action/id/$id" Is there any possibility to do this with Zend Framework? I do not want to forward the browser to that URL. I jus...

Default route doesnt work

Hey I'm using the standard routing module with pylons to try and setup a default route for the home page of my website. I've followed the instructions in the docs and here http://routes.groovie.org/recipes.html but when I try http://127.0.0.1:5000/ I just get the 'Welcome to Pylons' default page. My config/routing.py file looks like...

show products in category in a new page

I have a problem in Rails, I want to show products in each category on a separate page when user clicks on the proper link, categories and products have HABTM relation, I can see the results but I don't want to show them in default pages(routes). Should I create a new routes rule or this can be achieved in controller and view without edi...

Adding sub domain based routes in Zend framework

Hi, I am newbie to Zend framework, I am using .ini file to add routes in my application. I have 2 routes for different modules which resources.router.routes.news_view.type = "Zend_Controller_Router_Route_Regex" resources.router.routes.news_view.route = "([0-9\-]+)/([a-zA-Z0-9\-]+)\.html" resources.router.routes.news_view.defaults.mo...

Rails route helpers for map.connect

Hello all, in my current rails application I have a bunch of named routes defined to deal with the static content like this: map.with_options :controller => 'static_content' do |static| static.imprint 'imprint', :action => 'imprint' static.menu1 'menu1', :action => 'menu1' static.menu1_sub1 'menu1/sub1', :action =...

ASP.NET MVC - Routes

Hi, I'm working on an MVC application and I have and admin area... So what I need is: When user makes request to admin (for example "/Admin/Post/Add") I need to map this to controller AdminPost and action Add... is it possible? ...

How to handle non-existing routes in MVC that lead to errors?

In my application, I have some controllers that use specific routes and some that use the default route. As a result, I have something like this: //.. other more specific routes routes.MapRoute( "Workout - Specific Workouts by exercise", "{userName}/workouts/exercise/{exerciseID}/{exerciseName}", ...