i know this is n00b but i have searched and i can not figure it out. i am running instantrails on windows. i downloaded ajax_scaffold and installed using script/generate in a new rails project. after configing the db i can the following error when trying to access http://localhost:3001/invoices/list (invoices is the controller/table i built ajax_scaffold on)... NameError in InvoicesController#component uninitialized constant Invoice RAILS_ROOT: C:/INSTAN~1/rails_apps/mocerinotech/config/.. thanks --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
joe wrote:> NameError in InvoicesController#component > > uninitialized constant InvoiceProbably means you''re referencing the Invoice class without having created it. Do you have an Invoice model in app/models? Check there first. If you don''t have it, generate it via the command line with: ruby script/generate model invoice You''ll need to edit the migration file created for that model (in db/migrate), then run: rake db:migrate Try those things and let us know how it turns out. - Daniel -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
i have the model created and contains: require ''ajax_scaffold'' class Invoices < ActiveRecord::Base end i tried the rake db:migrate and i get the same error --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
joe wrote:> i have the model created and contains: > > require ''ajax_scaffold'' > > class Invoices < ActiveRecord::Base > > end > > i tried the rake db:migrate and i get the same errorHmm... a quick search on Google revealed that AjaxScaffold has been deprecated in favor of ActiveScaffold. Try this first: http://activescaffold.com/ -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
joe wrote:> i have the model created and contains: > > require ''ajax_scaffold'' > > class Invoices < ActiveRecord::Base > > end > > i tried the rake db:migrate and i get the same errorAlso, if that is your EXACT code, the problem might be there. Typically Rails model classes are singular, so Invoice instead of Invoices. I''d still shoot for ActiveScaffold though. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
yeah i read about that but when i try activeScaffold i get this error: NoMethodError in InvoicesController#list undefined method `active_scaffold'' for InvoicesController:Class so i was trying to get it to work in the older version first but i would rather use activeScaffold. the error above doesnt like the following line i added to my controller class: active_scaffold :Invoice any ideas? --~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
joe wrote:> yeah i read about that but when i try activeScaffold i get this error: > > NoMethodError in InvoicesController#list > > undefined method `active_scaffold'' for InvoicesController:Class > > so i was trying to get it to work in the older version first but i > would rather use activeScaffold. the error above doesnt like the > following line i added to my controller class: > active_scaffold :Invoice > > any ideas?Based on your errors it sounds like something isn''t being included properly. Undefined method is pretty obvious -- active_scaffold isn''t a defined method. Double-check with the AS documentation on how and where to include what. Since I have no experience with AS I can''t help you beyond that. -- 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
ok thanks On Jan 6, 12:37 am, Daniel Waite <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> joe wrote: > > yeah i read about that but when i try activeScaffold i get this error: > > > NoMethodError in InvoicesController#list > > > undefined method `active_scaffold'' for InvoicesController:Class > > > so i was trying to get it to work in the older version first but i > > would rather use activeScaffold. the error above doesnt like the > > following line i added to my controller class: > > active_scaffold :Invoice > > > any ideas? > > Based on your errors it sounds like something isn''t being included > properly. Undefined method is pretty obvious -- active_scaffold isn''t a > defined method. > > Double-check with the AS documentation on how and where to include what. > Since I have no experience with AS I can''t help you beyond that. > -- > 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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
couple thoughts: 1. that model should be singular - tables are plural - I would imagine it''s double important when you start relying on ORM in Rails 2. even though its probably better to use the newer activescaffold, ajaxscaffold should still work - deprication shouldnt be killing it 3. when you say ''config the db'' after generating as - that may have complicated things. I have had these same types of errors and noticed when I went back and created a new project clean and tried again they went away. On Jan 6, 2:07 am, joe <joe.mocer...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> ok thanks > > On Jan 6, 12:37 am, Daniel Waite <rails-mailing-l...-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> > wrote: > > > > > joe wrote: > > > yeah i read about that but when i try activeScaffold i get this error: > > > > NoMethodError in InvoicesController#list > > > > undefined method `active_scaffold'' for InvoicesController:Class > > > > so i was trying to get it to work in the older version first but i > > > would rather use activeScaffold. the error above doesnt like the > > > following line i added to my controller class: > > > active_scaffold :Invoice > > > > any ideas? > > > Based on your errors it sounds like something isn''t being included > > properly. Undefined method is pretty obvious -- active_scaffold isn''t a > > defined method. > > > Double-check with the AS documentation on how and where to include what. > > Since I have no experience with AS I can''t help you beyond that. > > -- > > Posted viahttp://www.ruby-forum.com/.- Hide quoted text - > > - Show quoted text ---~--~---------~--~----~------------~-------~--~----~ 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-/JYPxA39Uh5TLH3MbocFFw@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 -~----------~----~----~----~------~----~------~--~---