Hey all, I have this in routes: resources :cocore do collection do get :cocoreim end end I have this in ccore controller: class CoController < ApplicationController def index end def cocoreim render ''cocoreim'' end end In indx.html.erb of cocore view directory, I have this: <% link_to ''CoCore'', cocoreim_cocore_path %> I get undefined local variable or method cocoreim_cocore_path when trying to access the cocore controller page, even though cocore/cocoreim page renders fine. Why? I thought using collection block produces a helper which is a concatenation of the collection get method and the parent resource method. So what am I missing here? Thanks for response. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Phil On Mon, Feb 21, 2011 at 7:06 PM, John Merlino <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hey all, > > I have this in routes: > > resources :cocore do > collection do > get :cocoreim > end > end > > I have this in ccore controller: > > class CoController < ApplicationController > def index > end > > def cocoreim > render ''cocoreim'' > end > end > > In indx.html.erb of cocore view directory, I have this: > > <% link_to ''CoCore'', cocoreim_cocore_path %> > > I get undefined local variable or method cocoreim_cocore_path when > trying to access the cocore controller page, even though cocore/cocoreim > page renders fine.> Why? I thought using collection block produces a helper which is a > concatenation of the collection get method and the parent resource > method. So what am I missing here? > >Check rake routes. Is the route there?> Thanks for response. > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Is your controller class spelled correctly? You have> class CoController < ApplicationControllerbut are trying to reference a controller called cocore which would be class CocoreController. That may be why you are seeing the error. B. On Mon, Feb 21, 2011 at 7:30 PM, Phil Crissman <phil.crissman-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > Phil > > > On Mon, Feb 21, 2011 at 7:06 PM, John Merlino <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> >> Hey all, >> >> I have this in routes: >> >> resources :cocore do >> collection do >> get :cocoreim >> end >> end >> >> I have this in ccore controller: >> >> class CoController < ApplicationController >> def index >> end >> >> def cocoreim >> render ''cocoreim'' >> end >> end >> >> In indx.html.erb of cocore view directory, I have this: >> >> <% link_to ''CoCore'', cocoreim_cocore_path %> >> >> I get undefined local variable or method cocoreim_cocore_path when >> trying to access the cocore controller page, even though cocore/cocoreim >> page renders fine. >> >> Why? I thought using collection block produces a helper which is a >> concatenation of the collection get method and the parent resource >> method. So what am I missing here? >> > > Check rake routes. Is the route there? > >> >> Thanks for response. >> >> -- >> 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> To unsubscribe from this group, send email to >> rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org >> For more options, visit this group at >> http://groups.google.com/group/rubyonrails-talk?hl=en. >> > > -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to > rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. >-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> Check rake routes. Is the route there?Yeah, I had to use: cocoreim_cocore_index_path -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.