DoubleRenderError... again. ;-)

The first thing I notice is that you are rendering show twice:

def index
    show
    render(:action => 'show') and return
end

should just be

def index
    show
end

Joshua Muheim wrote:

The first thing I notice is that you are rendering show twice:

def index
   show
   render(:action => 'show') and return
end

should just be

def index
   show
end

That's not quite true. Just calling show doesn't make you render the
show template (unless the show method itself calls render :action =>
'show')

This should do the job

def show
   if some_authorisation_condition
     ... (don't call render or redirect
     return true
   else
     render(:file => "#{RAILS_ROOT}/public/404.html", :layout
=>false, :status => 404)
     return false
   end
end

def index
   if show
    render :action => 'show'
   end
end

Fred

Thats true, but he does have a render in there, and thats why I said
that. On second thought, a redirect_to might be better and always
render from show so that show can be called on it’s own as well.

-Bill

Frederick Cheung wrote: