Similar to #24 this PR adds #inertia_partial? to the request. It checks the header for X-Inertia-Partial-Data to distinguish between a full or partial request.
Example use case: In an application showing posts, I want to Increase the post's view counter for full requests only. Code from the controller:
class PostsController < ApplicationController
after_action :increase_view_count, only: [ :show ]
# ...
private
def increase_view_count
@post.punch(request) unless request.inertia_partial?
end
end
Similar to #24 this PR adds
#inertia_partial?
to the request. It checks the header forX-Inertia-Partial-Data
to distinguish between a full or partial request.Example use case: In an application showing posts, I want to Increase the post's view counter for full requests only. Code from the controller: