Skip to content

Commit fbff26d

Browse files
yi-jiayulcreid
authored andcommitted
[ci skip] readme: fix some syntax errors (#537)
Add missing commas between arguments in some of the code snippets for static controls
1 parent a085213 commit fbff26d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,15 +416,15 @@ Here's the output for a horizontal layout:
416416
You can also create a static control that isn't based on a model attribute:
417417

418418
```erb
419-
<%= f.static_control :field_name, label: "Custom Static Control" value: "Content Here" %>
419+
<%= f.static_control :field_name, label: "Custom Static Control", value: "Content Here" %>
420420
```
421421

422422
`field_name` may be any name that isn't already used in the form. Note that you may get "unpermitted parameter" messages in your log file with this approach.
423423

424424
You can also create the static control the following way, if you don't need to get the value of the static control as a parameter when the form is submitted:
425425

426426
```erb
427-
<%= f.static_control label: "Custom Static Control" value: "Content Here", name: nil %>
427+
<%= f.static_control label: "Custom Static Control", value: "Content Here", name: nil %>
428428
```
429429

430430
(If you neither provide a field name nor `name: nil`, the Rails code that submits the form will give a JavaScript error.)

0 commit comments

Comments
 (0)