This is ok but you can improve more this using respond_with.
```ruby
respond_to :html, :json
..
..
def create
  @category = Category.new(params[:category])
  flash[:success] = t('flash.category', message: t('flash.created')) if @category.save
  respond_with(@category)
end

# _new_category.html.haml  file
..
 = form_for(Category.new, remote: true, format: :json ) do |c|
```