You're using #find and not #find_by_id on the previous line so @content_view will never be nil here.