Nicolas Kassis
2008-Jul-16 14:16 UTC
Models and creating a scaffold under another controller
Hi, I''m trying to create a controller and model called Articles (yet another blogging system :) ) and put it under a controller called admin. I used the following command to do it: script/generate scaffold admin/article title:string user_id:integer body:text My issue is with the name that rails gives the model. Instead of calling it Article, the model is called Admin_Article. Is there a way to have the scaffold generator create the model as Article instead of Admin_article? Thank you. Nicolas Kassis --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
Thorsten Müller
2008-Jul-16 15:46 UTC
Re: Models and creating a scaffold under another controller
I''m not using scaffolding and so I can only guess. And you don''t exactly tell us, what Admin is. You say it''s a controller, but from what you do, it looks more like a namespace. To generate a controller in namespace admin you would do admin::controllername So script/generate scaffold admin::article title:string user_id:integer body:text Would most likely generate a controller & view in the admin namespace --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---