Replaced before_filter with before_action in categories_controller.rb

As per Rails 4 guidelines before_filter should be replaced with before_action