ruby - redirect to index if status code 500 -
ruby - redirect to index if status code 500 -
i've added show action on controller:
redirect_to shows_path, status: 500 doesn't seem doing trick.
i want go show index whenever there's internal server error (500) show action.
although think bad thing usability standpoint, add together rescue clause triggered when exception thrown:
def show # whatever rescue redirect_to shows_path, error: 'something bad happened' end ruby ruby-on-rails-3 ruby-on-rails-3.2
Comments
Post a Comment