Setting up Admin controller rails 2.02

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-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

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

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 / gissmoh.de / ror-ror.de / railswerk.de

On Dec 27, 10:50 am, “Kamau Osaze” [email protected] 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

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

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

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