routing

Scoped match routes in Rails

Is it possible to set scope for match routings. I have tried this: scope "/admin" do match ':controller/:action/:id' emd But it doesn't work. ...

ASP.NET webforms wildcard route

I'm using asp.net routing in a webforms app. I would like to achieve the following url format: http://[domain]/{parent-category}/{sub-category}/{sub-category} where the right most category is available as a route value. Currently I have achieved this with the following route: routes.MapPageRoute( "category-browse...

Symfony 1.4 functional tests - using routing rules in sfTestFunctional::get()

Unfortunately I'am currently forced to use concrete URI in my functional test (get('/articles/index') in case of my backend admin testing). It's obviously not good because this way im depending on concrete project URI settings which is not the point of this tests, is possibly somehow use routing rules in this get() method? ...

Devise Custom Routes and Login Pages

I'm trying to get Custom Routes working in my Rails application (Ruby 1.9.2 with Rails 3). This is my config/routes.rb file match '/dashboard' => 'home#dashboard', :as => 'user_root' devise_for :user do get "/login", :to => "devise/sessions#new" # Add a custom sign in route for user sign in get "/logout", :to => "devise/sessions#...

Two Separate Navigations on a Single Rails Page

I'm creating a rails app with two columns. On one side is a journal log and the other is a set of various links and resources to internal pages. I'd like to be able to navigate to different pages of the journal log on the left side without changing the content on the right. I'd also like to navigate through pages on the right without cha...

I have two network cards, the SMTP sends from working network card

Hi I have two network cards in my server, and both of them are connected, one is connected local and other one internet, I have created a SMTP service, the problem is that the smtp only tries sending emails from the local network card. I want it to try send emails from the internet network card, how can this be solved? ...

What is wrong with these Zend Framework routes from config file?

I was starting to get a LOT of routes in my bootstrap so I decided to move them to a config file to clean it up. I'm fairly sure I have the syntax correct, but for some reason my route won't work now. Here is my config file: <config> <routes> <indextracking type="Zend_Controller_Router_Route"> <route>crid/:crid</...

No route matches error for product_path in Rails

I have a resource called products and I believe it should create url helpers for products_path ("/products") and product_path ("/products/1"). While I get the first one, I cannot use the second. The error message says: No route matches {:controller=>"products", :action=>"destroy"} It appears to think I want to use the destroy actio...

Codeigniter, domain to a certain area of the site

Hi, I'm not a very experienced programmer, and am using CodeIgniter for second time. Suppose I have www.domain1.com. So I will have, say 3 controllers /area1, /area2, /area3. Users can access them as www.domain1.com/area1 etc. if I set the base URL as www.domain1.com. But my problem is, the client wants a certain area of the web, say ar...

url routing in zend framework

Hi I created several module for my own CMS like category, article, core , ... now how can I access these modules with url like: http://localhost/mycms/admin/category http://localhost/mycms/admin/article , ... note: the admin is not module, it's only prefix ...

Routing problem in ActiveScaffold with Rails 3.0

I'm trying out ActiveScaffold with Rails 3.0, still trying to get it to work at all. I'm getting an error No route matches {:active_scaffold=>true, :action=>"show_search", :controller=>"locations"} when I browse to http://localhost:3000/locations. I have "resources :locations, :active_scaffold => true" in my routes.rb, but I don't kno...

Missing slash causes 404 using RouteTable in ASP.NET

I have a ASP.NET 4.0 web application that uses System.Web.Routing.RouteTable for some routing. In my global.asax I have this code: protected void Application_Start(object sender, EventArgs e) { RouteTable.Routes.Add(new Route("", new PageRouteHandler("~/Documentation/Index.aspx"))); } The application resides in a virtual directory...

How do you test route constraints using RSpec

Given a couple of cities in the DB: City.first.attributes => {:id => 1, :name => 'nyc'} City.last.attributes => {:id => 2, :name => 'boston'} And a route like: match '/:city/*dest' => 'cities#do_something', :constraints => {:city => /#{City.all.map{|c| c.name}.join('|'}/} (so the constraints should evaluate to: /nyc|boston/) And a ...

Rails 3 routes - how can I automatically map each action (with exceptions)?

I am a relative beginner at Rails 3 routing and it has now caused me enough pain that I want to figure out the real solution. A couple of details: I have some semi-restful controllers that contain some methods outside the standard seven new, create, edit, update, destroy, etc. Generally, I want my routes page to map everything to 'con...

Feed Parsing In Rails

Hi, I am working on Ubuntu 10.04 and I am using feed-zirra to parse RSS feeds and I have MySQL database. I am trying to parse RSS feeds from Times of India Top Stories. There seems to be problem with the first link, I am sure TOI guys will correct it soon. But anyway, I dont want to face similar error later so thats why I want to ask ...

Rails 3, Custom Actions, and HTML request methods

I don't really understand the pro's and con's of using "post" vs "get" vs "put" requests, on custom controller actions, and whether to use links or forms/buttons. So let's say I have a simple to-do list with tasks, and a tasks controller, and I want a "complete" action where I find a specific task in the db and update it's status attri...

rails 3 routing question.

This is probably quite simple, but how can I make a params optional? resources :places match 'register/:id' => 'places#new', :as => :register currently... it breaks if the :id is not passed which most of the time it won't be. <%= link_to "Place Sign Up", register_path %> ...

what are these rails route doing?

Can someone please explain the following, with example urls? thanks a bundle! (a gem bundle!) resources :products do resource :category member do post :short end collection do get :long end end Resources maps all the routes in the ProductController right? How is category embedded? match 'products/:id', :to => 'ca...

Is it possible to preprocess the URL before mapping routes?

We're migrating a site from a proprietary framework to Ruby on Rails (v2.3). The current framework sometimes puts /base/ at the start of the URL for no discernible reason, and I'd like the existing URL to work, even though we won't give it out any more. My current solution, which I don't like, is to define the routes once on the main m...

How can we Route something like {calendar}/{controller}/{action}/{id}

As a beginner in MVC I'm trying to figure out what's the best way to accomplish a route for my needs, and I'm getting no luck at all, so I'm kindly ask for any help My webApp is driven by Calendars, and per each Calendar there are a bunch of actions Subscribe Edit Calendar View Winners Daily Challenge etc... and I would like to avoi...