# Setting up Admin controller rails 2.02

**URL:** <https://www.ruby-forum.com/t/setting-up-admin-controller-rails-2-02/124343>\
**Category:** Rails\
**Created:** [December 27, 2007, 7:50pm UTC](https://www.ruby-forum.com/t/setting-up-admin-controller-rails-2-02/124343 "2007-12-27T19:50:57Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kamau\_Osaze](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7ba0ec/32.png) [@Kamau\_Osaze](https://www.ruby-forum.com/u/Kamau_Osaze)\
**Post date:** [December 27, 2007, 7:50pm UTC](https://www.ruby-forum.com/t/setting-up-admin-controller-rails-2-02/124343/1 "2007-12-27T19:50:57Z")

</div>

Is there an easier way to set up and admin controller in rails other  
than

[Rolling with Rails 2.0 - The First Full Tutorial - Part 1 | AkitaOnRails.com](http://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-first-full-tutorial)?

This seems like way too much work. Please help if you can. Your help is  
greatly appreciated.

Thank you very much.

Kamau Osaze

---

<div class="post-metadata">

**Author:** ![Kamau\_Osaze](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7ba0ec/32.png) [@Kamau\_Osaze](https://www.ruby-forum.com/u/Kamau_Osaze)\
**Post date:** [December 27, 2007, 9:46pm UTC](https://www.ruby-forum.com/t/setting-up-admin-controller-rails-2-02/124343/2 "2007-12-27T21:46:41Z")

</div>

Am 27.12.2007 um 19:50 schrieb Kamau Osaze:

> Is there an easier way to set up and admin controller in rails other  
> than
> 
> [Rolling with Rails 2.0 - The First Full Tutorial - Part 1 | AkitaOnRails.com](http://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-first-full-tutorial)  
> ?
> 
> This seems like way too much work. Please help if you can. Your help  
> is greatly appreciated.

I’ am just working on a hotel booking application and I decided to  
give the administrator  
own controllers and views. For me it’s easier to maintain.

If I use the same template for guests and admins I have a lot of

\<% if !admin? %\>  
guest things to show  
\<% else %\>  
admin things to show  
\<% end &\>

…

so I decided to make it this way:

app  
controllers  
admin  
bookings\_controller.rb  
guests\_controller.rb  
…  
bookings\_controller.rb  
guest\_controller.rb

…

views  
admin  
bookings  
index.html.erb  
guests  
index.html.erb  
…  
bookings  
index.html.erb  
guests  
index.html.erb

I have a lot of files but for me it’s easier to maintain 2 templates -  
allowing me to generate  
2 completly different outputs without having lots of if - conditions.

–  
Jochen K.  
[figgfrosch.de](http://figgfrosch.de) / [gissmoh.de](http://gissmoh.de) / [ror-ror.de](http://ror-ror.de) / [railswerk.de](http://railswerk.de)

---

<div class="post-metadata">

**Author:** ![Kamau\_Osaze](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/7ba0ec/32.png) [@Kamau\_Osaze](https://www.ruby-forum.com/u/Kamau_Osaze)\
**Post date:** [December 27, 2007, 11:21pm UTC](https://www.ruby-forum.com/t/setting-up-admin-controller-rails-2-02/124343/3 "2007-12-27T23:21:34Z")

</div>

On Dec 27, 10:50 am, “Kamau Osaze” [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is there an easier way to set up and admin controller in rails other than
> 
> [http://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-fir](http://www.akitaonrails.com/2007/12/12/rolling-with-rails-2-0-the-fir)…

This thread has links to other articles besides Akita’s:

[http://groups.google.com/group/rubyonrails-talk/browse\_thread/thread/f6c1b3a546e7e240?hl=en](http://groups.google.com/group/rubyonrails-talk/browse_thread/thread/f6c1b3a546e7e240?hl=en)

In particular, using a single controller with conditional logic is  
discussed in one article.

///ark
