I have a controller named RegistriesController. It contains a single method: def edit @jolts_registry = JoltsRegistry.new end This runs, and the associated view is invoked. That stops on line 9: <%= form_for @jolts_registry do |f| %> The message is: undefined method `jolts_registries_path'' for #<#<Class:0x184fdd4>:0x1cf7aa0> What does that mean? -- Tim Slattery Slattery_T-R43zzhgHTig@public.gmane.org -- 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 https://groups.google.com/groups/opt_out.
On Aug 21, 2012, at 4:12 PM, Tim Slattery wrote:> I have a controller named RegistriesController. It contains a single > method: > > def edit > @jolts_registry = JoltsRegistry.new > end > > This runs, and the associated view is invoked. That stops on line 9: > > <%= form_for @jolts_registry do |f| %> > > The message is: > > undefined method `jolts_registries_path'' for > #<#<Class:0x184fdd4>:0x1cf7aa0>It means you haven''t set up a route for it in routes.rb, but you''re using one of the route helpers in your view anyway. But have you inspected what this named class is? Is it an instance of your JoltsRegistry model, or maybe nil? Walter> > What does that mean? > > -- > Tim Slattery > Slattery_T-R43zzhgHTig@public.gmane.org > > -- > 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 https://groups.google.com/groups/opt_out. > >-- 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 https://groups.google.com/groups/opt_out.
On 21 August 2012 21:12, Tim Slattery <Slattery_T-R43zzhgHTig@public.gmane.org> wrote:> I have a controller named RegistriesController. It contains a single > method: > > def edit > @jolts_registry = JoltsRegistry.new > end > > This runs, and the associated view is invoked. That stops on line 9: > > <%= form_for @jolts_registry do |f| %> > > The message is: > > undefined method `jolts_registries_path'' for > #<#<Class:0x184fdd4>:0x1cf7aa0> > > What does that mean?Have you put an entry for jolts_registries in routes.rb? Probably something like resources :jolts_registries form_for needs the route to generate the form tag. 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 https://groups.google.com/groups/opt_out.
Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:>On 21 August 2012 21:12, Tim Slattery <Slattery_T-R43zzhgHTig@public.gmane.org> wrote: >> I have a controller named RegistriesController. It contains a single >> method: >> >> def edit >> @jolts_registry = JoltsRegistry.new >> end >> >> This runs, and the associated view is invoked. That stops on line 9: >> >> <%= form_for @jolts_registry do |f| %> >> >> The message is: >> >> undefined method `jolts_registries_path'' for >> #<#<Class:0x184fdd4>:0x1cf7aa0> >> >> What does that mean? > >Have you put an entry for jolts_registries in routes.rb? Probably >something like >resources :jolts_registriesI have match ''/registries'' => ''registries#edit; It clearly finds the route, otherwise it wouldn''t run the edit method in registries_controller.>form_for needs the route to generate the form tag.Don''t understand, which route? -- Tim Slattery Slattery_T-R43zzhgHTig@public.gmane.org -- 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 https://groups.google.com/groups/opt_out.
On 22 August 2012 13:47, Tim Slattery <Slattery_T-R43zzhgHTig@public.gmane.org> wrote:> Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > >>On 21 August 2012 21:12, Tim Slattery <Slattery_T-R43zzhgHTig@public.gmane.org> wrote: >>> I have a controller named RegistriesController. It contains a single >>> method: >>> >>> def edit >>> @jolts_registry = JoltsRegistry.new >>> end >>> >>> This runs, and the associated view is invoked. That stops on line 9: >>> >>> <%= form_for @jolts_registry do |f| %> >>> >>> The message is: >>> >>> undefined method `jolts_registries_path'' for >>> #<#<Class:0x184fdd4>:0x1cf7aa0> >>> >>> What does that mean? >> >>Have you put an entry for jolts_registries in routes.rb? Probably >>something like >>resources :jolts_registries > > I have > > match ''/registries'' => ''registries#edit; > > It clearly finds the route, otherwise it wouldn''t run the edit method > in registries_controller.It is not that route that is the problem> >>form_for needs the route to generate the form tag. > > Don''t understand, which route?You are trying to create a form for a JoltRegistry, that expects to submit to a jolts_registries_path (as in the error message). The normal way to generate the route would be to use resources :jolts_registries Have a look at the Rails Guide on Routing if you don''t know what that does. 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 https://groups.google.com/groups/opt_out.
Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:>> Don''t understand, which route? > >You are trying to create a form for a JoltRegistry, that expects to >submit to a jolts_registries_path (as in the error message). The >normal way to generate the route would be to use >resources :jolts_registriesI''ve done that. Same message. I''ve tried several different permutations of methods, etc. Always the exact same message. I have no clue in the world what in the hell it wants me to do. I have no clue where it gets "jolts_registries" from in the first place. -- Tim Slattery Slattery_T-R43zzhgHTig@public.gmane.org -- 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 https://groups.google.com/groups/opt_out.
On 22 August 2012 17:38, Tim Slattery <Slattery_T-R43zzhgHTig@public.gmane.org> wrote:> Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > >>> Don''t understand, which route? >> >>You are trying to create a form for a JoltRegistry, that expects to >>submit to a jolts_registries_path (as in the error message). The >>normal way to generate the route would be to use >>resources :jolts_registries > > I''ve done that. Same message. I''ve tried several different > permutations of methods, etc. Always the exact same message. I have no > clue in the world what in the hell it wants me to do. I have no clue > where it gets "jolts_registries" from in the first place.In your first post you had @jolts_registry = JoltsRegistry.new so @jolts_registry is of JoltsRegistry and hence the route it is looking for. Did you restart the server after changing routes.rb? That is one of the few times it is necessary to restart it. If it is still not working post your routes.rb file, the output from rake routes and copy and paste the error message and the section of code it relates to. Did you read and understand the guide on routing? 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 https://groups.google.com/groups/opt_out.
Tim Slattery <Slattery_T-R43zzhgHTig@public.gmane.org> wrote:>Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > >>> Don''t understand, which route? >> >>You are trying to create a form for a JoltRegistry, that expects to >>submit to a jolts_registries_path (as in the error message). The >>normal way to generate the route would be to use >>resources :jolts_registries > >I''ve done that. Same message. I''ve tried several different >permutations of methods, etc. Always the exact same message. I have no >clue in the world what in the hell it wants me to do. I have no clue >where it gets "jolts_registries" from in the first place.Changing the form tag from <%= form_for @registry do |f| %> to <%= form_for @registry, :url => { :action => "create" } do |f| %> fixed it. -- Tim Slattery Slattery_T-R43zzhgHTig@public.gmane.org -- 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 https://groups.google.com/groups/opt_out.
On 22 August 2012 21:08, Tim Slattery <Slattery_T-R43zzhgHTig@public.gmane.org> wrote:> Tim Slattery <Slattery_T-R43zzhgHTig@public.gmane.org> wrote: > >>Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: >> >> >>>> Don''t understand, which route? >>> >>>You are trying to create a form for a JoltRegistry, that expects to >>>submit to a jolts_registries_path (as in the error message). The >>>normal way to generate the route would be to use >>>resources :jolts_registries >> >>I''ve done that. Same message. I''ve tried several different >>permutations of methods, etc. Always the exact same message. I have no >>clue in the world what in the hell it wants me to do. I have no clue >>where it gets "jolts_registries" from in the first place. > > Changing the form tag from > > <%= form_for @registry do |f| %>It was not that in the first place, according to your post it was <%= form_for @jolts_registry do |f| %> Colin> > to > > <%= form_for @registry, :url => { :action => "create" } do |f| %> > > fixed it. > > -- > Tim Slattery > Slattery_T-R43zzhgHTig@public.gmane.org > > -- > 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 https://groups.google.com/groups/opt_out. > >-- 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 https://groups.google.com/groups/opt_out.
Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:>It was not that in the first place, according to your post it was ><%= form_for @jolts_registry do |f| %>ah..Right. I tried a good many things, kept getting the exact same error until putting the "action" phrase in. yes I looked at the routing doc. Didn''t see anything to help. Still don''t get it. -- Tim Slattery Slattery_T-R43zzhgHTig@public.gmane.org -- 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 https://groups.google.com/groups/opt_out.
selva4210-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2012-Aug-24 10:51 UTC
Re: Re: "Undefined method"
On Thu, Aug 23, 2012 at 6:17 PM, Tim Slattery <Slattery_T-R43zzhgHTig@public.gmane.org> wrote:> Colin Law <clanlaw-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote: > > >>It was not that in the first place, according to your post it was >><%= form_for @jolts_registry do |f| %> > > ah..Right. I tried a good many things, kept getting the exact same > error until putting the "action" phrase in. yes I looked at the > routing doc. Didn''t see anything to help. Still don''t get it. >It would be more helpful for the people if you post your routes.rb here. -- Azhagu Selvan http://tamizhgeek.in -- 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 https://groups.google.com/groups/opt_out.