routes

Producing proper routes in a nested tree in codeigniter

Hi, I am pretty new to CodeIgniter and PHP in general and have two questions that are somewhat related. I have a nested category tree with unlimited depth that produces links like myapp.com/language and myapp.com/spanish but I would like to have something like myapp.com/language/spanish. For reference my model returns an array of array...

Named route with nested resources

I'm trying to make a named route 'have_many' other named routes here. But the way I'm doing it's not working. Here is my problem: I've several game platforms that I want to access by /:platform_name/. This is working: map.platform ':platform_name', :controller => :platforms, :action => :index, ...

named routes arguments

Hello, I've started this question http://stackoverflow.com/questions/2370882/named-route-with-nested-resources, and it lead me to this new one. I've a named route defined in my routes: map.game ':platform_name/:game_name', :controller => :games, :action => :index, :platform_name => /pc|...

using map.root on rails to map to a static path

I'm using static URLs in my RoR project. There is really no controller or action to map to so I tried putting in map.root "/static_page" or map.root "static_page" but I get errors. How do I just map to a path? Edit: I am using a controller to serve up static pages, these aren't html pages, but a static controller I'm using here: http://...

Rails Route that Updates or Redirects

Im not sure if I'm doing this right. I have an action that I would like to either copy, create, and save a new object if a user is logged in, or redirect if they are not logged in. Im not using a form here because I am using a stylized button with an image that looks like this: <a href="/lists/add/<%= @list.id %>" class="button"> <s...

Rails routes - show action as root

I'm looking to make a show action of one of my controllers the root. I can easily do this: map.root :controller => 'articles', :action => 'index' When I go to localhost:3000/ it lists all the articles - that's great! What I want to achieve, though, is a URL like this localhost:3000/1 To display an article with the id 1. Changing th...

Displaying HTML pages in an ASP.Net MVC Web App

I have a simple MVC site but I need to add in some static HTML pages, I have tried to add an IgnoreRoute in for .html files but this didn't work. ...

Combining Codeigniter routes with regex

Hi, I've been playing around with creating an e-commerce site with Codeigniter, and am trying to do the following: Have category names as the first parameter, e.g. /tshirts /shoes following each of these, is either a filter (on the category), or the product (with category in URL for SEO) /tshirts/filter/price/0-20 /tshirts/pink-wi...

map.resource, parameter restrictions

I've a controller :platform here. I'm trying to do something like: /:platform_name/ to redirect to its show, with the parameter. Here is what I've got: map.resource :platform, :as => ':platform_name', :platform_name => /pc|ps2|ps3|wii|ds|psp|xbox-360/ It's working fine. I've other neasted resources to i...

How do I set a default page in Pylons?

I've created a new Pylons application and added a controller ("main.py") with a template ("index.mako"). Now the URL http://myserver/main/index works. How do I make this the default page, ie. the one returned when I browse to http://myserver/ ? I've already added a default route in routing.py: def make_map(): """Create, configure a...

Codeigniter Routes regex

looking for a one line route to route dashed controller and method names to the actual underscored controller and method names. url /controller-name/method-name-which-is-long/ would route to /controller_name/method_name_which_is_long/ see: http://codeigniter.com/forums/viewreply/696690/ which gave me the idea to ask :) ...

Cannot see index view of my controller - routing related

Hi. I have a controller named Content, which has an Index action, which is associated with a view. I would like the simple route "content" to show me the index view of the content controller, so I use the following code (with the addition of the default site home route): routes.MapRoute( "ContentIndex", ...

How do ASP.NET MVC Routes work?

Hi folks, I have the following route's defined: public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( "Default", "{controller}/{action}/{id}", new { controller = "Home", action = "Index", id = "" } ); // Added custom route...

rails is loading from routes instead of the public folder

I have a rails app. I have a file in #{RAILS_ROOT}/public/swfs/somthing.swf. Locally, when running with webrick, when I go to the url localhost:3000/swfs/something.swf, my swf loads just fine. My routes.rb file looks like the following ActionController::Routing::Routes.draw do |map| map.connect ':controller/:action/:id' map.conn...

2 pages using the same url using rails routes.

Im trying make a login page for my rails application that looks like "www.domain.com" and when you login you still are still located at the domain "www.domain.com". Is there a way that I can map 2 different actions to the same url using routes. Twitter does it this way, you log in at twitter.com and after you are logged in you are still ...

Namespace with index action in Rails

I have an admin controller located inside /controllers/admin/admin_controller.rb I also have a pages controller located inside /controllers/admin/pages_controller.rb In my routes.rb file, I have the following: map.namespace :admin do |admin| admin.resources :pages end When the user goes to localhost:3000/admin, I'd like the us...

Using ajax actions with google friendly route

I am attempting to beautify my routes so that they follow the syntax of lists/name-of-list/id as per here: http://gregmoreno.ca/how-to-create-google-friendly-urls-in-rails/ I have defined a new route like so: map.list_permalink 'lists/:name/:id', :controller => 'lists', :action => 'show' Everything works fine, but my existing ajax met...

No action responded to search

i have defined a method called 'search' in my RecipesController which is not private. in routes.rb i have the following: map.connect 'recipes/search', :controller => :recipes, :action => :search i get the following error: No action responded to search. Actions: ... where my method 'search' does not appear in the actions list...

Rewriting An URL With Regular Expression Substitution in Routes

In my Pylons app, some content is located at URLs that look like http://mysite/data/31415. Users can go to that URL directly, or search for "31415" via the search page. My constraints, however, mean that http://mysite/data/000031415 should go to the same page as the above, as should searches for "0000000000031415." Can I strip leading...

How to get "paster request" to use config host value instead of localhost?

I'm trying to access my pylons application via cron job to send notifications to my users. The way I'm doing this is by running the application using something like: paster request myconfig.ini /maintenance/do In the actual controller I check for the "paste.command_request" to block public access. Everything works but the only problem...