Skip to content

Commit

Permalink
Tweak README to add scalar position to strong parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
brendon committed Mar 6, 2024
1 parent 4edc03d commit 7618c6f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ item.update position: {after: 11}

It can be tricky to provide the hash forms of relative positioning using Rails form helpers, but it is possible. We've declared a special `Struct` for you to use for this purpose.

Firstly you need to allow nested Strong Parameters for the `position` column like so:
Firstly you need to allow both scalar and nested Strong Parameters for the `position` column like so:

```ruby
def item_params
params.require(:item).permit :name, position: [:before]
params.require(:item).permit :name, :position, position: [:before]
end
```

Expand Down

0 comments on commit 7618c6f

Please sign in to comment.