cman77
cman77

Reputation: 1783

Best way to handle admin form rails

I have a site where users can post job listings - nothing too crazy, just a simple job.rb model etc. I'd like to add an admin site where certain folks w/ access can view, edit and delete jobs that have been posted.

I already have an edit jobs form that is used during the job creation process (a user can preview and then go back and edit the job they just created if they aren't happy with it). I'd like to try and re-use this edit form on the admin side of things (albeit in a different template/wrapper).

So on the front end I have example.com/job/123/edit and on the admin side i'm guessing i'll have something like example.com/admin/job/123.

What is the DRYest way to handle this scenario given that:

  1. The submit buttons will have different text
  2. The update action will redirect to different pages

Upvotes: 0

Views: 155

Answers (1)

revolver
revolver

Reputation: 2405

Maybe you can take a look at cancan

Upvotes: 1

Related Questions