Rails Scaffold for Existing Model

107 views
Skip to first unread message

raji

unread,
Oct 10, 2009, 4:45:08 PM10/10/09
to Ruby on Rails: Talk
I've got a Rails app with a 'User' model and a 'users' controller.

The users controller handles user registration in the Rails app.

I'd like to build a user admin feature using a namespaced controller
titled 'admin/users'. Since all I need are the basic CRUD functions,
is it possible to generate a scaffold for the User model in the 'admin/
users' controller?

Pat

unread,
Oct 13, 2009, 10:05:44 AM10/13/09
to Ruby on Rails: Talk
Hi there,

I’ve actually just started working on a gem I call "ViewMapper" that
creates view scaffolding from existing models:

http://patshaughnessy.net/view_mapper

It can create the standard CRUD scaffolding you're looking for, or
setup views that work with other plugins/gems like auto_complete,
paperclip, etc. It won’t support specifying a namespace, although
that’s an interesting idea. You will have to:
1. Move/rename your existing users controller and view code; leave the
user model there
2. Use view mapper to create a new controller/view for users
3. Move the new one to admin/users and restore your old code.

- pat

Guo Yangguang

unread,
Oct 13, 2009, 11:45:48 AM10/13/09
to rubyonra...@googlegroups.com
is there any options for scaffold script?
--
Posted via http://www.ruby-forum.com/.
Reply all
Reply to author
Forward
0 new messages