views:

22

answers:

0

Im using 2 different sets of views for 2 different user's roles. Im using register_alias :

Mime::Type.register_alias "text/html", :basic

in the controller:

class SomeController < ApplicationController
  def index
    # …
    respond_to do |format|
      format.html  # index.html.erb (advance)
      format.basic # index.basic.erb
    end
  end
end

In some case I have to use the same code in both views, then I would use a Partial, but because of the MIME alias, I have to use 2 identical partials: my_partial.html.erb and my_partial.basic.erb

I think there is a solution to DRY the code and use only a partial.

Do you have some solutions ?

thank you, Alessandro