# How to use One controller's CRUD methods from another controller?

**URL:** <https://discuss.rubyonrails.org/t/how-to-use-one-controllers-crud-methods-from-another-controller/63409>\
**Category:** rubyonrails-talk\
**Created:** [March 28, 2012, 11:54am UTC](https://discuss.rubyonrails.org/t/how-to-use-one-controllers-crud-methods-from-another-controller/63409 "2012-03-28T11:54:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pallav\_bfs](https://avatars.discourse-cdn.com/v4/letter/p/e495f1/32.png) [@Pallav\_bfs](https://discuss.rubyonrails.org/u/Pallav_bfs)\
**Post date:** [March 28, 2012, 11:54am UTC](https://discuss.rubyonrails.org/t/how-to-use-one-controllers-crud-methods-from-another-controller/63409/1 "2012-03-28T11:54:31Z")

</div>

In a sample app,we have one controller called employee\_controller.This one has its model and view parts. Now can we create another controller(say,emp\_controller,which shouldn't have model or view parts) in such a way that one can access all employee's methods through emp\_controller.

That means,GET on [http://server:3000/emp/\{:id\}](http://server:3000/emp/%5C%7B:id%5C%7D) would give same results as a GET on [http://server:3000/employee/\{:id\}](http://server:3000/employee/%5C%7B:id%5C%7D) would do?

Or,[http://server:3000/emp/\{:id\}/skill/](http://server:3000/emp/%5C%7B:id%5C%7D/skill/) would give same results as a GET on [http://server:3000/employee/\{:id\}/expertise/](http://server:3000/employee/%5C%7B:id%5C%7D/expertise/) would do?

[whereas emp is the controller mapping to employee and skill is the controller mapping to expertise]

And I do not want to redirect to original urls(employee or employee/id/ expertise). The new front-end urls with emp and skill controllers should be sufficient to get tha data from original urls and show.

---

<div class="post-metadata">

**Author:** ![Colin\_Law1](https://avatars.discourse-cdn.com/v4/letter/c/91b2a8/32.png) [@Colin\_Law1](https://discuss.rubyonrails.org/u/Colin_Law1)\
**Post date:** [March 28, 2012, 12:06pm UTC](https://discuss.rubyonrails.org/t/how-to-use-one-controllers-crud-methods-from-another-controller/63409/2 "2012-03-28T12:06:10Z")

</div>

Set up routes for those actions so that emp url goes to the appropriate employee controller actions.

Colin
