[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=>"tick

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 > Frederick Cheung wrote in post #1034554: > > On Dec 1, 11:28am, Vogon Primo wrote: > >> POST /projects/:project_id/tickets(.:format) > >> > >> It invokes the show action and not the index action. Why? >

[Rails] Re: routes problem

2011-12-01 Thread Vogon Primo
Frederick Cheung wrote in post #1034554: > On Dec 1, 11:28am, Vogon Primo 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 but it has

[Rails] Re: routes problem

2011-12-01 Thread Frederick Cheung
On Dec 1, 11:28 am, Vogon Primo 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", :controller=

[Rails] Re: Routes problem in form

2011-01-09 Thread rwz
yes, it will work On Jan 10, 1:34 am, JD wrote: > On Jan 9, 6:14 pm, Frederick Cheung > wrote: > > > On Jan 9, 1:10 pm, JD 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 tha

[Rails] Re: Routes problem in form

2011-01-09 Thread JD
On Jan 9, 6:14 pm, Frederick Cheung wrote: > On Jan 9, 1:10 pm, JD 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

[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 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 and have name

[Rails] Re: Routes problem in form

2011-01-09 Thread Frederick Cheung
On Jan 9, 1:10 pm, JD 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 simply by saying

[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

[Rails] Re: Routes problem

2009-08-29 Thread Matt Jones
On Aug 28, 2:43 pm, Himanshu Prakash 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: > Product

[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 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: > > map.resources :*proj

[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.hom

[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*, :collection

[Rails] Re: Routes problem

2009-08-28 Thread Ar Chron
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. I tend to think of it as adding them 'inline' As Ro

[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 Fr

[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", :contro

[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 => { :

[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 rou