I have a ruby on rails controller that will display a different form for a logged out user than a logged in user.
What is the best way to approach this? (Is the below way ok?)
class UsersController < ApplicationController
def index
if logged_in && is_admin
render 'admin_index'
end
#use default index
end
end
Sure thats fine except you might get a ‘cannot render action twice’ type error (if im admin and logged in it still would try to render the default after rendering the admin action)
might be better