AshJsonApi.Resource.Routes.PostToRelationship (ash_json_api v0.24.0) View Source

Link to this section Summary

Functions

A POST route to create related entities using resource identifiers

Link to this section Functions

Link to this macro

post_to_relationship(relationship, action, opts \\ [])

View Source (macro)

A POST route to create related entities using resource identifiers

Examples

post_to_relationship :comments, :default

Arguments

  • :relationship

  • :action - The action to call when this route is hit

Options

  • :route - The path of the route - Defaults to /:id/relationships/[relationship_name]

  • :primary? - Whether or not this is the route that should be linked to by default when rendering links to this type of route The default value is false.