[Rails] Re: routing question

2011-09-19 Thread 7stud --
Slava Mikerin wrote in post #1022739: > Hello, > I wonder how to tell my routes.rb to route requests to a resource to > it's parent controller > > class Foo < Bar > end > > > resources :foos ===> controller :bars resources :foos, :controller => :bars -- Posted via http://www.ruby-forum.com/. -

[Rails] Re: routing question

2011-09-19 Thread Tim Shaffer
Check out the guide for routing, especially the part on "specifying a controller to use" under "customizing restful resources" http://guides.rubyonrails.org/routing.html#customizing-resourceful-routes -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:

[Rails] Re: Routing Question

2011-09-01 Thread Bruno Meira
h, That's what I do to fix my routing. I guess that my question generated a little confusion ;/. Sorry for any incovenience Thx all -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk

[Rails] Re: Routing Question

2011-09-01 Thread Conrad Taylor
On Sep 1, 7:03 am, 7stud -- wrote: > Conrad Taylor wrote in post #1019592: > > > On Thu, Sep 1, 2011 at 1:53 AM, 7stud -- wrote: > > >> > The above can easily be fixed by adding a $ after the *.  For example, > > >> > /^[1-9]\d*$/ > > >> Why do you continue to claim that you can use anchors in a

[Rails] Re: Routing Question

2011-09-01 Thread 7stud --
Bruno Meira wrote in post #1019487: > Hi 7stud, > I wanted a URL like that: /users/:id, where :id could only be one or > more integers, actually the user id. > What is it that you find lacking in the normal rails routing, e.g. resources :users that requires you to change it? -- Posted via http

[Rails] Re: Routing Question

2011-09-01 Thread 7stud --
Bruno Meira wrote in post #1019487: > Hi 7stud, > I wanted a URL like that: /users/:id, where :id could only be one or > more integers, actually the user id. > I don't have in mind any case that this line could'nt be resolve. > Could you give me an example? > Thx ;D Sure, your route+constraint mat

Re: [Rails] Re: Routing Question

2011-08-31 Thread Conrad Taylor
On Wed, Aug 31, 2011 at 3:07 PM, Bruno Meira wrote: > Hi 7stud, > I wanted a URL like that: /users/:id, where :id could only be one or > more integers, actually the user id. > I don't have in mind any case that this line could'nt be resolve. > Could you give me an example? > Thx ;D > > If this is

[Rails] Re: Routing Question

2011-08-31 Thread Bruno Meira
Hi 7stud, I wanted a URL like that: /users/:id, where :id could only be one or more integers, actually the user id. I don't have in mind any case that this line could'nt be resolve. Could you give me an example? Thx ;D -- You received this message because you are subscribed to the Google Groups "

[Rails] Re: Routing Question

2011-08-31 Thread 7stud --
First, why don't you actually give an example of the url you want to map to the show action??? Second, that regex does not meet your requirements. You may think it works well, but that just means you didn't test it well enough. -- Posted via http://www.ruby-forum.com/. -- You received this

[Rails] Re: Routing Question

2011-08-31 Thread Bruno Meira
My constraint stayed like that: :constraints => { :id => / [1-9]\d*/ } -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email t

[Rails] Re: Routing Question

2011-08-31 Thread Bruno Meira
I do like Conrad said and the code works well. Thx ;D -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+

Re: [Rails] Re: Routing Question

2011-08-31 Thread Conrad Taylor
On Wed, Aug 31, 2011 at 12:01 PM, Conrad Taylor wrote: > On Wed, Aug 31, 2011 at 7:51 AM, 7stud -- wrote: > >> Conrad Taylor wrote in post #1019393: >> > On Wed, Aug 31, 2011 at 7:04 AM, Bruno Meira >> > wrote: >> > >> >> >> > Bruno, I would recommend reading section 4.2 of the Rails routing gu

Re: [Rails] Re: Routing Question

2011-08-31 Thread Conrad Taylor
On Wed, Aug 31, 2011 at 7:51 AM, 7stud -- wrote: > Conrad Taylor wrote in post #1019393: > > On Wed, Aug 31, 2011 at 7:04 AM, Bruno Meira > > wrote: > > > >> > > Bruno, I would recommend reading section 4.2 of the Rails routing guide: > > > > I read that, and I don't see how applying a regex to

[Rails] Re: Routing Question

2011-08-31 Thread Bruno Meira
Hi All, Thanks for answer my question. I read http://guides.rubyonrails.org/routing.html#segment-constraints and I guess that the best way to resolve my problem is do like Jim said, put the route in match and add except constraint in resource. Thanks All ;D -- You received this message because yo

Re: [Rails] Re: Routing Question

2011-08-31 Thread Jim Ruther Nill
On Wed, Aug 31, 2011 at 10:51 PM, 7stud -- wrote: > Conrad Taylor wrote in post #1019393: > > On Wed, Aug 31, 2011 at 7:04 AM, Bruno Meira > > wrote: > > > >> > > Bruno, I would recommend reading section 4.2 of the Rails routing guide: > > > > I read that, and I don't see how applying a regex to

[Rails] Re: Routing Question

2011-08-31 Thread 7stud --
Conrad Taylor wrote in post #1019393: > On Wed, Aug 31, 2011 at 7:04 AM, Bruno Meira > wrote: > >> > Bruno, I would recommend reading section 4.2 of the Rails routing guide: > I read that, and I don't see how applying a regex to the id will help. How about adding :show to the :except clause and

[Rails] Re: Routing Question

2011-08-31 Thread 7stud --
7stud -- wrote in post #1019391: > How about: > > match '/:id' => 'users/show' > resources :users, :except=>[:destroy] Sorry, that doesn't meet your requirements because both '/1' and '/show/1' will match. -- Posted via http://www.ruby-forum.com/. -- You received this message because you are

[Rails] Re: Routing Question

2011-08-31 Thread 7stud --
How about: match '/:id' => 'users/show' resources :users, :except=>[:destroy] -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk@googlegroups.

[Rails] Re: routing question

2010-02-21 Thread Dudebot
Sorry for this post--this of course turned out to be a phusion/apache configuration issue. Mea culpa. Although it's really teaching me how important restful routes are :) Craig On Feb 20, 5:50 pm, Dudebot wrote: > I'm pushing my rails app to a server.  My local development machine > has localho

[Rails] Re: Routing question

2009-04-14 Thread Tim
map.resources :jobs, :as => :alias Hope that helps! Tm On Apr 14, 6:59 am, DanC wrote: > I have a resource for jobs on my application and I am familiar with > RESTful routes etc. I am also happy adding some custom routes to my > controller. > > My question is, can I create an alias controller,