routes

MVC route map problem

I have a page where I am displaying some urls in HTML ActionLink here is the code... Sl.No. Office Name the code is generating link like http://localhost:3819/Description/Description/Clerical_Glendale I want to make this link look like ... http: // l...

Problem with Url.Content in ASP.NET MVC on Default Route

If I use the following line in my default view /Home/Index <script language="javascript" src="<%=Url.Content("~/Scripts/jquery-1.3.2.js")%>" type="text/javascript" ></script> If I surf to this location using the following url http://127.0.0.1:9999/Home/Index the page gets rendered correctly <script language="javascript" src="/Scripts...

How to set routes.rb for ONLY controller and view object?

I have a controller called store_controller, and views for store. But the store doesn't have the model, but I want to use store_path in the code. How can I add the store_path in routes.rb? ...

How can I implement vanity URL's in a Rails application?

I want users to able to have a profile page at site.com/myNameHere. Rails looks for a controller named "myNameHere." Is it possible to setup routes.rb so that if the controller is not found, "myNameHere" gets sent as a parameter to another controller? ...

Rails: Authlogic failed login URL?

On a vanilla Authlogic install set up a la Ryan Bate's Railscast #160, when a user goes to login and the session FAILS, the url changes from /login to /user_session (Of course, it shows the validation errors and all that jazz.) I want to keep the URL always at /login, even on failure (and still display the login errors). How woul...

My route is not firing, should this work?

For my administration area I have created a special route. I did this so my urls look cleaner, and it avoids the problem of me having 2 controllers with the same name. Example: I have a UserController and another AdminUserController for the admin site of the application. I don't want URL's like: http://www.example.com/user/... http:...

Rails - Succinctly finding the parent resource of a polymorphically nested resource

Suppose I have a polymorphic structure like this. map.resources :bar, :has_many => :foo map.resources :baz, :has_many => :foo map.resources :qux, :has_many => :foo class Foo belongs_to :parent, :polymorphic => true end class FooController < AC before_filter :find_parent ... private def find_parent # ugly way: @parent = if ...

Routes in Pylons: Mapping to explicit .htm file

How do I write a route to map to an explicit .htm file? E.g. I have a something.htm under /templates in Pylons and I want to map http://myserver.com/something.htm to something.htm under /templates. Can I do this with Routes for Pylons or does everything get mapped to some combination of /controller/action/id ? I would assume one way is...

Does Google provide a http page to return a XML route?

I have been using a lot of Google Maps's API for getting geocoding and reverse geocoding services. Do you know if there's a service (through http) that would return a route? ...

Zend Framework - How do make a hierarchy without it being a module?

Here is my specific issue. I want to make an api level which then under that you can select which method you will use. For example: test.com/api/rest test.com/api/xmlprc Currently I have api mapping to a module directory. I then setup a route to make it a rest route. test.com/api is a rest route, but I would rather have it be test.com...

What makes an effective URL Mapping implementation and why?

I am looking at implementing URLMapping for a personal project. I am already aware that solutions exist so please do not answer suggesting I should use one. What I want is to harvest the opinions of fellow developers and web users on URL mapping implementations. Specially I would like you to answer: Which is your favourite implementa...

Rails: Alternative ways to serve multiple layouts? e.g. iphone.example.com vs. example.com/iphone

I can use this method to signal an alternative layout. someformat.example.com but when I cache that it will be in, for example public/someformat Why involve DNS and the web server if I don't have to? Is there a way to make a Rails app just stay in a url subdir, i.e. to make all url generation relative? I'm attempting this for a Fa...

django routes help

Hay guys, im making a simple car sale website. I have a nice little urlpattern which works well as expected /car/1/ goes to a car with that id, simple? However, for SEO reasons i want to add extra data to the URL, but ignore it. /car/1/ford/focus as an example, how would i go about modifying my patters to take the extra parts into...

MVC: capture route url's and pass them to javascript function

Short:Is there a way to have a route-definition that will pass the "CONTROLLER/ACTION" string value to a javascript function in stead of actually going straight for the controller action? More:I have a masterpage which contains the navigation of the site. Now, all the pages need this navigation wrapped around it at all times, but becaus...

Destroy method doesn't work when using custom routes in Rails

#routes.rb map.connect '/articles/new', :controller => 'articles', :action => 'new' map.connect '/articles/:author_name', :controller => 'articles', :action => 'show' map.connect '/articles/:author_name/edit', :controller => 'articles', :action => 'edit' map.resources :articles, :comments When I got to /articles/test and click delete,...

Correct Routing for :has_many :through

I am trying to set up a Many-to-Many association between 2 objects. I have gone through several tutorials and have been able to correctly set up the model. My problem is that I am having having trouble setting up the correct routes so I can view the full relationship... something like only displaying the products from a specific catego...

Rails: How can I configure to routes.rb for /:id?

I am working on my personal site with RoR. I searched and read books. But I cannot figure out. How Can I configure routes.rb for xxxxx.com/:id? For example: twitpic.com's image url or short url is "http://twitpic.com/11u1cy". ...

How can i create a route that returns a URL without controller reference in ASP.NET MVC

Hi All, I have a controller call DefaultController. Inside this controller i have views for what would be the equivalent of static pages. The URLs look like www.site.com/Default/PageName Is it possible to create a route that would format these URL like: www.site.com/PageName I want to avoid creating controllers for each of these. An...

MVC - Application root appears twice in url using Url.Content/Url.Action

I have several mvc applications on the same domain, each have their own directory. mydomain.com/app1 mydomain.com/app2 etc.. When using Url.Content() and Url.Action() when at the root level, 'app1' part is repeated twice in the urls. // code used to generate the links <%= Url.Action("tetris", "Apps") %> Page Url: mydo...

ASP.NET MVC Route not working with constraint

Hi, I'm having trouble getting a Route working in order to constrain the parameters of an action of a controller to only be integers. I have a a controller action as follows: [RequiresRole(RoleToCheckFor = "Administrator"), AcceptVerbs(HttpVerbs.Get)] public ActionResult Edit(int id) { ... } and the following ...