similar to: Routes problem.

Displaying 20 results from an estimated 100000 matches similar to: "Routes problem."

2006 Nov 17
6
RESTful routes and resulting urls
if I have the following in my routes.rb: map.resources :product_categories it provides urls such as: /product_categories /product_categories/1 /product_categories/1;edit etc. and uses the ProductCategories controller. how can I keep the same controller (and model) but set up the resources so that I can have any abitrary url point to the existing controller, much like specifying the controller
2008 Mar 12
2
nested routes with a 2-way has_many using join table?
I have two classes, InstructionalObject and Assets. They both have_many of the other, implemented through a join table (so it''s like a habtm without the habtm). For the next version of our app, we''re refactoring to RESTful, and i''m having trouble with my nested resources/routes. I tried this, in routes.rb: map.resources :assets do |assets| assets.resources
2007 Apr 09
8
How do I use link_to with all the current options?
In one of my pages I want to create some URLs that go to the same page, but tack on an extra parameter (column sorting stuff). How do I do that? I''ve tried link_to "Title", :sort => "title" and that''s pretty close...it keeps the controller name, but it doesn''t include one of the parameters. I''m using nested routes, so the URL should
2008 Jul 19
1
Routes
Hi there, I''m having an issue with routes I frankly dont get. I have a controller named map which takes in a hash string and converts that to an actual url, works great so localhost:3000/f3gg or whatever works fine now, I have a controller which I want to use to add some records (needs to go through AJAX) I want two strings, from and to but nevermind that for now since I''m too
2008 Mar 12
3
Newbie Routing Question /site/1/edit vs. /site/edit/1
I have a question about how URLs are created. This happens with the edit action on the controller. Instead of creating the URL as http://site.com/edit/1 it sticks the ID in the middle: http://site.com/1/edit Two questions: 1. What exactly is the reason behind this default? 2. How do I override it? I''ve tried searching but I''m not sure what terminology that I should search
2007 Sep 06
3
routes, default_url_options and languages
Hello, My app is available in 2 languages, English (en) and French (fr). *I would like all my URLs to look like this :* /fr/companies /en/companies *I''ve setup this route :* map.connect '':lg/:controller/:action/:id'' I don''t want to specify the :lg parameter in every url_for calls. The language remains the same unless the params[:change_lg] is set. *In my
2008 Feb 25
3
customize resource routes
Hi all, I have this application that lists videogames, which i am rewriting to follow REST. I need to have this url : /games/xbox360/halo-3 ( map.connect "/ games/:platform_id/:permalink",:controller => "games",:action => "show" ) This is no problem with map.connect, but with map.resources i can not make this. map.resources :games do |game|
2008 Jul 19
2
renaming routes.rb
When you create a new rails app the default home page says to rename routes.rb. I tried this, but when I run script/console or script/server I get an error saying the routes.rb file can''t be found. If you rename this file is there an environment variable holding the location elsewhere in the application? -- Posted via http://www.ruby-forum.com/.
2007 Jun 12
1
Route Regex Requirement not working properly
I''m trying to get my routes to work properly. Here''s how I''m defining one of my routes: map.downloads '':category/downloads'', :controller => ''downloads'', :action => ''list_downloads_for_category'', :requirements => {:category => DownloadableFileCategory.category_regex} And here''s the method
2007 Aug 25
4
REST routes :has_many , new style
I am trying to write a nested route ''new style'' map.resources :franchises, :has_many => :documents in place of the : map.resources :franchises do |franchises| franchises.resources :documents, :name_prefix => "franchise_" end but get an error : no route found to match "/franchises/1/documents" with {:method=>:get} running rake routes,
2009 Jan 04
4
Adding routes and link_to
Hello. I''ve added some routes : map.news ''news'', :controller => :News, :action =>:index map.login ''login'', :controller => :Login , :action =>:index When I go to /news or /login before adding the routes, it works well. When I add the routes and clik on the link that goes to /news or / login, I got a 500 internal error with this :
2007 Dec 10
11
map.namespace, rake routes yields no POST URLs
routes.rb map.namespace :admin do |admin| admin.resources :cupcakes end rake routes cupcakes GET /cupcakes formatted_cupcakes GET /cupcakes.:format POST /cupcakes POST /cupcakes.:format That said, what the heck goes here: form_for(:cupcake, @cupcake, xxx_url) # ??? Calling create_admin_cupcake_url yields... undefined local variable
2007 Feb 20
1
Urls generated by nested map.resources
Hi, Apologies if this has been answered before. I have just started to try out the new RESTful routes. For resources that aren''t related to anything else, everything makes sense - for resources with relationships, I am less certain of what the "right" thing to do - especially in relation to the urls produced, and how to modify those urls. For example, if I have teams and
2009 Mar 06
2
Routes.recognize_path on more complicated Routes
For a permissions system i''m writing i''m extending the standard link_to helpers to check if a user has a permission to perform that action before displaying a link to clean-up my code so i don''t have to put if checks all over them. I''m trying to use.. ActionController::Routing::Routes.recognize_path(url, :method => method) to get the action and controller
2006 Mar 23
10
Domain Requirements in Routes (Edge Rails)
I saw on the bottom of the following page that you can route requests to different controllers based upon which subdomain is being requested. http://wiki.rubyonrails.com/rails/pages/Routes with_options :requirements=>{:subdomain=>''first.com''} do map.connect '''', :controller => "first/catalog" map.connect ''featured'',
2007 Oct 03
3
manually invoking routing?
Hey folks. I have a rails controller which is filtering search results for access control. The search results are typically URLs into the rest of the rails app. I''m finding it would simplify the grotty code which is accumulating if I could manually invoke the router. That is to say, if I could send something a URI path string and get back the hash of controller, action, and params that
2007 Apr 01
2
"-" instead of "_" in routes?
Hi all I''d like to have minus signs "-" instead of underscores "_" in my routes. Is there an easy to do that? my_controller/show_something/123 # <= not cool my-controller/show-something/123 # <= much cooler Thanks a lot Josh -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you
2006 Jan 24
1
Query String in routes.
Is there any way to access the query string full request uri in routes.rb? I''d like to route requests for those going after my old application urls to my new rails application urls. The old app used /wiki.cgi?PageName The rails app uses /wiki/show/PageName Like... map.connect ''wiki.cgi'', :controller => "wiki", :action => "show", :id =>
2006 Mar 25
1
routes mapping, subdomains and page-caching
Each of its own is no problem, but the combination of them is confusing my head ! I want to to map in routes.rb an url for an article which is identified by its permalink. The permalink is unique per subdomain. Has anybody done that and can post an example ? Should I do subdomain filtering in routes.rb so I can get page-cachabled URLs (and URL rewriting in Lighttpd form subdomain-urls to
2007 Dec 03
4
Resource routing methods -- what am I missing?
Alright, I''ve been doing map.resources routing for a while now, so whatever I''m missing must be something stupid and obvious... Anyone care to help me out? -- routes.rb: # ... map.resources :algorithms, :collection => { :search => :post } do |algorithm| algorithm.resources :snippets end # ... -- snippets_controller.rb class SnippetsController < ApplicationController