Hey everyone, I get this error for some reason when trying to access my new action. Here''s the error: undefined method `repositories_path'' for #<ActionView::Base:0x1034c7648> Heres my view code: <% form_for(@repository) do |f| %> <%= f.error_messages %> <p> <%= f.label :name %><br /> <%= f.text_field :name %> </p> <p> <%= f.label :owner %><br /> <%= f.text_field :owner %> </p> <p> <%= f.label :private %><br /> <%= f.check_box :private %> </p> <p> <%= f.submit ''Update'' %> </p> <% end %> My repository controller is a resources in routes. Whats wrong?! Thanks, jakx12. -- 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.
On Sat, Nov 27, 2010 at 3:43 PM, Zack Nathan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hey everyone, > > I get this error for some reason when trying to access my new action. > Here''s the error: > undefined method `repositories_path'' for #<ActionView::Base:0x1034c7648> > > Heres my view code: > > <% form_for(@repository) do |f| %>It is expected by your view that the controller serving up this view has defined a model instance @repository.> <%= f.error_messages %> > > <p> > <%= f.label :name %><br /> > <%= f.text_field :name %> > </p> > <p> > <%= f.label :owner %><br /> > <%= f.text_field :owner %> > </p> > <p> > <%= f.label :private %><br /> > <%= f.check_box :private %> > </p> > <p> > <%= f.submit ''Update'' %> > </p> > <% end %> > > My repository controller is a resources in routes. Whats wrong?! > > Thanks, > > jakx12. > > -- > 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@googlegroups.com. > 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.
Brian Troutwine wrote in post #964363:> On Sat, Nov 27, 2010 at 3:43 PM, Zack Nathan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> > wrote: >> Hey everyone, >> >> I get this error for some reason when trying to access my new action. >> Here''s the error: >> undefined method `repositories_path'' for #<ActionView::Base:0x1034c7648> >> >> Heres my view code: >> >> <% form_for(@repository) do |f| %> > > It is expected by your view that the controller serving up this view > has defined a model instance @repository.Thanks for the reply. I do have an instance, it says: @repository = Repository.new -- 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.
On 27 November 2010 21:17, Brian Troutwine <brian-MmYI4SXeg2M3tL2svhKZZQ@public.gmane.org> wrote:>> undefined method `repositories_path'' for #<ActionView::Base:0x1034c7648> > > It is expected by your view that the controller serving up this view > has defined a model instance @repository.More likely (due to the "repositories path") to be a routing problem. Zack, do you have "map.resources :repositories" in your routes.rb file? -- 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.
On Nov 27, 10:50 pm, Michael Pavling <pavl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On 27 November 2010 21:17, Brian Troutwine <br...-MmYI4SXeg2M3tL2svhKZZQ@public.gmane.org> wrote: > > >> undefined method `repositories_path'' for #<ActionView::Base:0x1034c7648> > > > It is expected by your view that the controller serving up this view > > has defined a model instance @repository. > > More likely (due to the "repositories path") to be a routing problem. > Zack, do you have "map.resources :repositories" in your routes.rb > file?Or, if you''re on Rails 3.0 "resources :repositories" -- 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.
Jaap Haagmans wrote in post #964371:> On Nov 27, 10:50pm, Michael Pavling <pavl...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> On 27 November 2010 21:17, Brian Troutwine <br...-MmYI4SXeg2M3tL2svhKZZQ@public.gmane.org> wrote: >> >> >> undefined method `repositories_path'' for #<ActionView::Base:0x1034c7648> >> >> > It is expected by your view that the controller serving up this view >> > has defined a model instance @repository. >> >> More likely (due to the "repositories path") to be a routing problem. >> Zack, do you have "map.resources :repositories" in your routes.rb >> file? > > Or, if you''re on Rails 3.0 "resources :repositories"I dont actually. My routes for repository looks like this: map.resources :repository, :has_many => :bugs -- 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.
On 27 November 2010 22:10, Zack Nathan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:>>> More likely (due to the "repositories path") to be a routing problem. >>> Zack, do you have "map.resources :repositories" in your routes.rb >>> file? > > I dont actually. My routes for repository looks like this: map.resources > :repository, :has_many => :bugsso try changing it to : map.resources :repositories, :has_many => :bugs (assuming your controller is call "RepositoriesController" rather than "RepositoryController" -- 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.
Michael Pavling wrote in post #964379:> On 27 November 2010 22:10, Zack Nathan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>>> More likely (due to the "repositories path") to be a routing problem. >>>> Zack, do you have "map.resources :repositories" in your routes.rb >>>> file? >> >> I dont actually. My routes for repository looks like this: map.resources >> :repository, :has_many => :bugs > > > so try changing it to : > > map.resources :repositories, :has_many => :bugs > > (assuming your controller is call "RepositoriesController" rather than > "RepositoryController"my controller is called RepositoriesController. I just dont see where the problem is! Its super strange.. -- 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.
On 27 November 2010 22:37, Zack Nathan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> I just dont see where the problem is! Its super strange..For the last time... have you done this?>> so try changing it to : >> >> map.resources :repositories, :has_many => :bugs >>You might notice, that your current route mapping is singular, and the one I''ve suggested using is plural... -- 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.
Michael Pavling wrote in post #964384:> On 27 November 2010 22:37, Zack Nathan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> I just dont see where the problem is! Its super strange.. > > For the last time... have you done this? > >>> so try changing it to : >>> >>> map.resources :repositories, :has_many => :bugs >>> > > You might notice, that your current route mapping is singular, and the > one I''ve suggested using is plural...But does that work with a singular named controller? Thanks, jakx12 -- 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.
Michael Pavling
2010-Nov-27 23:30 UTC
Re: Re: Re: Re: I have a NoMethodError, please help!
On 27 November 2010 23:24, Zack Nathan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:>> You might notice, that your current route mapping is singular, and the >> one I''ve suggested using is plural... > > But does that work with a singular named controller? > Thanks,You don''t *have* a singular named controller... and if you did why would you be mapping resources for it? -- 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.
Marnen Laibow-Koser
2010-Nov-27 23:30 UTC
Re: Re: Re: I have a NoMethodError, please help!
Zack Nathan wrote in post #964388: [...]>> You might notice, that your current route mapping is singular, and the >> one I''ve suggested using is plural... > > But does that work with a singular named controller?Why do you want a singular-named controller? Plural is the usual convention, unless you have a singular resource (in which case you need "resource", not "resources", in your routes file). Learn the Rails conventions and understand them before you try to break them.> Thanks, > > jakx12Best, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- 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.
Michael Pavling wrote in post #964391:> On 27 November 2010 23:24, Zack Nathan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >>> You might notice, that your current route mapping is singular, and the >>> one I''ve suggested using is plural... >> >> But does that work with a singular named controller? >> Thanks, > > You don''t *have* a singular named controller... and if you did why > would you be mapping resources for it?My controller is named repository. I have the resource named repository because then I can have url like this: www.xxxx.com/repository/1/bugs/1. Is this wrong? Thanks, jakx12. -- 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.
Michael Pavling
2010-Nov-27 23:53 UTC
Re: Re: Re: Re: Re: I have a NoMethodError, please help!
On 27 November 2010 23:46, Zack Nathan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:>> You don''t *have* a singular named controller... and if you did why >> would you be mapping resources for it? > > My controller is named repository.you said earlier:> my controller is called RepositoriesController....now you''re saying is actually RepositoryController?> I have the resource named repository > because then I can have url like this: www.xxxx.com/repository/1/bugs/1. > Is this wrong?Yes... Marnen''s post covers this too - the Rails convention is: www.xxxx.com/repositories/1/bugs/1 -- 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.
Hello, I read the whole mailing, and not sure if I agree. So first this problem means you don''t have the method in the Controller. I agree, controllers have naming conventions, check those. Also routes.rb has conventions, depends on version - which do you use? If you''ve written your route to the file, you can check if it''s available from command line: rake routes Here you will see the url path and the pathname also, so will be visible if you gave it wrong. Which versions do you use? Did you scaffolded or created part by part? cheers, Zoltán On nov. 27, 20:43, Zack Nathan <li...-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> Hey everyone, > > I get this error for some reason when trying to access my new action. > Here''s the error: > undefined method `repositories_path'' for #<ActionView::Base:0x1034c7648> > > Heres my view code: > > <% form_for(@repository) do |f| %> > <%= f.error_messages %> > > <p> > <%= f.label :name %><br /> > <%= f.text_field :name %> > </p> > <p> > <%= f.label :owner %><br /> > <%= f.text_field :owner %> > </p> > <p> > <%= f.label :private %><br /> > <%= f.check_box :private %> > </p> > <p> > <%= f.submit ''Update'' %> > </p> > <% end %> > > My repository controller is a resources in routes. Whats wrong?! > > Thanks, > > jakx12. > > -- > Posted viahttp://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@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Zoltan Gero wrote in post #964442:> Hello, > I read the whole mailing, and not sure if I agree. > > So first this problem means you don''t have the method in the > Controller. I agree, controllers have naming conventions, check those. > Also routes.rb has conventions, depends on version - which do you use? > > If you''ve written your route to the file, you can check if it''s > available from command line: > rake routes > Here you will see the url path and the pathname also, so will be > visible if you gave it wrong. > > Which versions do you use? Did you scaffolded or created part by part? > cheers, > ZoltnI scaffolded it. Im using rails 2.3.8. Sorry I meant that my controller is named singularly. So do you guys think I should pluralize it? Thanks, jakx12. -- 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.
On 28 November 2010 12:31, Zack Nathan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote:> [...] > I scaffolded it. Im using rails 2.3.8. Sorry I meant that my controller > is named singularly. So do you guys think I should pluralize it? >Model should be Repository in repository.rb Controller should be RepositoriesController in repositories_controller.rb Colin -- 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.
Colin Law wrote in post #964458:> On 28 November 2010 12:31, Zack Nathan <lists-fsXkhYbjdPsEEoCn2XhGlw@public.gmane.org> wrote: >> [...] >> I scaffolded it. Im using rails 2.3.8. Sorry I meant that my controller >> is named singularly. So do you guys think I should pluralize it? >> > > Model should be Repository in repository.rb > Controller should be RepositoriesController in > repositories_controller.rb > > Colinalrighty, thanks! -- 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.
I Like to order ugg boots,they are 100% original, and they are very cheap and good secvice, Non Tax,Free Shipping. if you like it,you can buy it from this company. www uggscom com really? -- 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.