Different views for different user's types

I have to create a web app with 2 different user's types: advanced and basic.

What's the best way to manage different user's views (one for user's type) ?

I am using respond_to in this way:

    respond_to do |format|       case current_operator.op_type       when 'basic'         format.html { render :template => "devices/index_basic.html.erb" }       when 'advanced'         format.html # index.html.erb       end     end

but I don't like that I need to specify render :template => "devices/basic_action_page.html.erb" in every respond_to

Do you know some cleaner way to do that ?

thank you, Alessandro

Something like:

kind = current_operator.op_type == "basic" ? "_basic" : nil

format.html { render :template => "devices/index#{kind}.html.erb"

And factor that in its own before_filter method or alike.

Fernando Perez wrote:

Something like:

kind = current_operator.op_type == "basic" ? "_basic" : nil

format.html { render :template => "devices/index#{kind}.html.erb"

And factor that in its own before_filter method or alike.

thank you, this is a good trick, but in this way I have to specify the template in all action (index, show, ...) Does exist some solution more simple ?

Alessandro