Rails Scaffold for Existing Model

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?

Hi there,

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


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

is there any options for scaffold script?

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs