routing

routing in rails3 with custom primary id

Hi, I have model with custom primary key: document.rb class Document < ActiveRecord::Base set_primary_key "token" end routes.rb: MyApp::Application.routes.draw do resources :documents, :only => [:index, :show, :create] end When i create new document, i get error: No route matches {:controller=>"documents", :id=>#<Document id:...

asp.net 4.0 webforms url routing

Hi guys and girls, I seem to have a problem fully understanding url routing. Like on an aspx page called News.aspx I want to show the full news listing, on the page News.aspx?view=detail&id=x I want to show the news details. And on the Page News.aspx?view=browse&pageindex=1 I want users to be able to browse to the archives. So basiclly...

Using Bluetooth for sending files to remote mobiles using near mobiles!!

I need your opinion about my graduation project idea, Using Bluetooth for sending files to remote mobiles by routing on near mobiles with enabled blue tooth and use them as intermediate stations until the sent files reach their destination. Do you think its feasible and is appropriate for a graduation project? ...

What is the best practice to localize my MVC routes, page names and actions

Hi, I couldn't find any documentation about this around so please help. I need to localize my web site URLs like the samples below; website.com/home/about website.com/anasayfa/hakkinda also action names will have to be localized as page names; website.com/AdList/12/Details website.com/IlanListesi/12/Detaylar As you see it seem...

How to Create This Route in CakePHP

I want to create a route something like: http://images.example.com/[models]/[sizes]_[filename].[extension] [models] = (blog|event|user) [sizes] = (t|s|l|o) [filename] = example [extension] = (png|gif|jpg) How do I create the route for this? I've tried the following w/ no success: Router::connect('/:model/:size\_:filename.:extens...

Best practices with Forms Authentication and Routing?

My site (WebForms, C# 4.0) is using Forms Auth and by default requires login: <authorization> <deny users="?"/> </authorization> I allow unauthenticated access to the public folder (http://siteurl.com/member/public): <location path="member/public"> <system.web> <authorization> <allow users="?"/> </authorization> ...

asp.net webforms routing: optional parameters

Hi All, I want to add optional parameters in my routing table. For example I would like the users to browse a product catalog like this: http://www.domain.com/browse/by-category/electronics/1,2,3 etc Now i've created a route like this: routes.MapPageRoute( "ProductsBrowse", "browse/{BrowseBy}/{Categ...

Rails 3 Redirect using POST

Is it possible to redirect from one controller to another using POST request? redirect_to supports only GET. I found something called "post_via_redirect", but it seems that it was deprecated in Rails 3. ...

strange rails routing and ActionView::Template problem

I have following in my routes.rb: namespace "admin" do resources :categories end resources :categories and all works well. However, as I remove or comment out: "resources :categories" part namespace "admin" do resources :categories end #resources :categories I am getting: ActionView::Template::Error (undefined method `cat...

Asp.net Routing - Route constraints and empty Route

I have a url that I want to map routing to: http://siteurl.com/member/edit.aspx?tab=tabvalue where tabvalue is one of: "personal", "professional", "values" or nothing. I want to map it to a route like: Member/Edit/{tab} But my problem is - I don't know how to specify such constraints. I'm trying this regex: ^[personal|professiona...

rails problem with routing and constraints

I have a problem with routing with an id conditioned by a regex constraint. My route is: resources :albums, :constraints => { :id =>/[a-zA-Z\d\.\-\_]+$/ } do get :offline, :on => :member end If I do this: GET /content/v1/albums/:id(.:format) {:action=>"show", :controller=>"content/v1/albums", :id=>/[a-zA-Z\d\.\-\_]+$/ It w...

How can I serve static content from outside of the project - rails

Without using a symlink, how can I serve images that are outside of the rails project? I though there might be some routes magic but I can find what I'm looking for... Lets say images are at ~/images and the application is at ~/app. ...

Rails 3 routing based on context

Greetings, I am trying to implement a "context" system similar to the one used by GitHub. For example, a Post may be created belonging either to the User or one of the Companies the User belongs to depending on whether to User is in the "User" context or a context that refers to one of the Companies. As a part of this, I'd like to be a...

Symfony pass two models to route

Hi. I have this routing.yml: post: class: sfDoctrineRouteCollection options: { model: BlogPost } I need this url: /company/24/mycompany/blog/post/13. How how I can pass to my route 2 models to generate following route: //Test route example post_show: url: /company/:id/:title_slug/blog/post/:post_id param: { module: c...

Zend Framework paginator force $_GET params usage

Is it possible to use paginator with $_GET parameters? For example i have a route like this: $router->addRoute('ajax_gallery', new Routes_Categories( '/:lang/:category/age/:dep/:cat/:towns', array( "page" => 1, "dep" => 0, "cat" => 0, "towns" => 0 ), array( "dep" => "[0-9]+", "cat" => "[0-9]+" ) )); And i'm making request like this ...

Cakphp, redirecting in the routing.

Hi, I was wondering how to do a redirect in the routes of a cakephp application. I simply want to redirect on url /xxx to /yyy I don't want to have to set up a controller or and action in the pages controller just to redirect a url. Is there a way to do it in the routing? Cheers. ...

ASP.NET MVC2 Custom routing with wildcard or free text url

I have a requirement to add specific functionality to an asp.net mvc2 web site to provide addtional SEO capability, as follows: The incoming URL is plain text, perhaps a containing a sentence as follows "http://somesite.com/welcome-to-our-web-site" or "http://somesite.com/cool things/check-out-this-awesome-video" In the MVC pipeline,...

How do I create a view that is aware of full route. (Rails 3)

How can I design my view such that it "remembers" its route? So that "Back" on /team/1/members/1 links to /team/1/members and /members/1 links back to /members? I have models of team and member. Teams have many members. My routes allow me to view all member or members on a team. resources :teams do resources :members end re...

ASP.NET MVC Appends ' ?RouteValueDictionary ' to my routes

Hi, I'm doing some changes on my routes, and suddenly the following is appearing in my url's as a querystring: ?RouteValueDictionary=System.Web.Routing.RouteValueDictionary So, my url's now look like http://localhost:20367/Search/AdvancedSearchResults?RouteValueDictionary=System.Web.Routing.RouteValueDictionary How do I make it d...

asp.net mvc routing - rewrite url

after debbuging i am getting following url of my webproject: http://localhost:54594/Home/Home /Home-Controller/Home-Action http://localhost:54594/AboutUs/AboutUs /AboutUs-Controller/AboutUs-Action http://localhost:54594/Products/Products /Products-Controller/Products-Action In my global.asax i ha...