[Rails] Re: routes problem

2011-12-01 Thread Frederick Cheung
On Dec 1, 11:28 am, Vogon Primo li...@ruby-forum.com wrote: Hi all, In a sample project, I have a nested resource called ticket, and parent resource called project. rake routes: ... project_tickets GET    /projects/:project_id/tickets(.:format)                        {:action=index,

[Rails] Re: routes problem

2011-12-01 Thread Vogon Primo
Frederick Cheung wrote in post #1034554: On Dec 1, 11:28am, Vogon Primo li...@ruby-forum.com wrote: POST /projects/:project_id/tickets(.:format) It invokes the show action and not the index action. Why? It's also doing weird stuff because it hasn't picked a project_id from the url

Re: [Rails] Re: routes problem

2011-12-01 Thread thiagocifani
in your path are you sending the project object as params? 2011/12/1 Vogon Primo li...@ruby-forum.com Frederick Cheung wrote in post #1034554: On Dec 1, 11:28am, Vogon Primo li...@ruby-forum.com wrote: POST /projects/:project_id/tickets(.:format) It invokes the show action and

[Rails] Re: routes problem

2011-12-01 Thread Vogon Primo
Vogon Primo wrote in post #1034547: Hi all, In a sample project, I have a nested resource called ticket, and parent resource called project. rake routes: ... project_tickets GET/projects/:project_id/tickets(.:format) {:action=index, :controller=tickets}

[Rails] Re: Routes problem in form

2011-01-09 Thread Frederick Cheung
On Jan 9, 1:10 pm, JD jdg@gmail.com wrote: Hello all, I'm relatively new to rails and have been doing ok with it but I have run into an issue that I'm sure has a really easy solution that I just can't seem to see. Do you want admin_carriers_path? You can probably simplify things

[Rails] Re: Routes problem in form

2011-01-09 Thread JD
Well I've figured this one out so no worries. On Jan 9, 1:10 pm, JD jdg@gmail.com wrote: Hello all, I'm relatively new to rails and have been doing ok with it but I have run into an issue that I'm sure has a really easy solution that I just can't seem to see. Basically I have an app

[Rails] Re: Routes problem in form

2011-01-09 Thread JD
On Jan 9, 6:14 pm, Frederick Cheung frederick.che...@gmail.com wrote: On Jan 9, 1:10 pm, JD jdg@gmail.com wrote: Hello all, I'm relatively new to rails and have been doing ok with it but I have run into an issue that I'm sure has a really easy solution that I just can't seem to

[Rails] Re: Routes problem in form

2011-01-09 Thread rwz
yes, it will work On Jan 10, 1:34 am, JD jdg@gmail.com wrote: On Jan 9, 6:14 pm, Frederick Cheung frederick.che...@gmail.com wrote: On Jan 9, 1:10 pm, JD jdg@gmail.com wrote: Hello all, I'm relatively new to rails and have been doing ok with it but I have run into an issue

[Rails] Re: Routes problem

2009-08-29 Thread Matt Jones
On Aug 28, 2:43 pm, Himanshu Prakash vision2...@gmail.com wrote: Hi John, try this approach: in the Product class add this function- require 'uri'   def self.find_custom arg     object = self.new     object.id = URI.escape(arg)     object   end and in the controller try calling as:

[Rails] Re: Routes problem

2009-08-29 Thread Rob Biedenharn
On Aug 28, 2009, at 2:02 PM, John Mcleod wrote: Since I've been learning rails, I thought that routes are the linking of the Controller Object to their Action method. When you set up RESTful routing, you need to add custom or named routes after the default 7. To set up custom or named

[Rails] Re: Routes problem

2009-08-28 Thread Rob Biedenharn
On Aug 28, 2009, at 11:34 AM, John Mcleod wrote: Hello all, Here's a newbie question (4 weeks and counting). My routes.rb is as below. map .resources :projects, :departments, :users, :admins, :imports, :notes #Below is route in question map.resources :projects, :collection = { :view_all

[Rails] Re: Routes problem

2009-08-28 Thread John Mcleod
Since I've been learning rails, I thought that routes are the linking of the Controller Object to their Action method. When you set up RESTful routing, you need to add custom or named routes after the default 7. To set up custom or named routes, you use map.connect path/to/view, :controller =

[Rails] Re: Routes problem

2009-08-28 Thread Himanshu Prakash
Hi John, try this approach: in the Product class add this function- require 'uri' def self.find_custom arg object = self.new object.id = URI.escape(arg) object end and in the controller try calling as: Product.find_custom(params[:id]).view_all just try it, and let me know. On

[Rails] Re: Routes problem

2009-08-28 Thread James Englert
ROR will attempt to find routes from the top of the file first and then move on to the rest of the file. It would seem that you have listed projects twice: map.resources :*projects*, :departments, :users, :admins, :imports, :notes #Below is route in question map.resources :*projects*,

[Rails] Re: Routes problem

2009-08-28 Thread Ar Chron
John Mcleod wrote: Hello all, Here's a newbie question (4 weeks and counting). My routes.rb is as below. map.resources :projects, :departments, :users, :admins, :imports, :notes #Below is route in question map.resources :projects, :collection = { :view_all = :get } map.home '',

[Rails] Re: Routes problem

2009-08-28 Thread E. Litwin
Another tip is to run rake routes to see all the available routes. On Aug 28, 9:26 am, James Englert englert.ja...@gmail.com wrote: ROR will attempt to find routes from the top of the file first and then move on to the rest of the file. It would seem that you have listed projects twice:

[Rails] Re: Routes problem.

2008-10-13 Thread Daniel
On Oct 13, 10:30 am, gdiazl [EMAIL PROTECTED] wrote: Hello, Just a single problem i can't solve. The scenario... I have a controller called places but i don't want to link the users to /places/whatever, i want something like /no/whatever. How to achieve this? I have in my routes.rb: