This should not create a problem at all as I do it all the time. My guess is that you are assuming that render and redirect_to immediately return from a method, but they don't. All redirect_to does is add a 302 header to the response object that is sent back to the browser. Without seeing your code, all I can do is assume, but try changing the redirect_to line to something like the following (notice the && return):
def member_requests(right_name, obj, options = {}, &block)
if
logged_in_member.has_system_right?(SystemRight.find_by_model_class_and_name(obj.to_s,
right_name))
yield if block_given?
else
render :file => "#{RAILS_ROOT}/public/404.html", :layout => true,
:status => 404
end
end
And that's where the DoubleRenderError is thrown! Anyone can see where
the problem is? I just want to render the 404.html file, nothing else...
No double rendering or stuff!