Sha256: 38c053783551b57cfb944c607569f65aa1066bc0c028826a6f94ab58112b639c

Contents?: true

Size: 1.13 KB

Versions: 4

Compression:

Stored size: 1.13 KB

Contents

# Form action (`FormAction`)

Form action defines the endpoint to which browser will make a request after submitting it.

As a general rule you should use relative path like `action="/my/path"` instead of for example `action="my/path"` to avoid errors.

## Check Details

This check is aimed at ensuring you have not forgotten to start the path with /.

:-1: Examples of **incorrect** code for this check:

```liquid
<form action="dummy/create">
 ...
</form>
```

:+1: Examples of **correct** code for this check:

```liquid
<form action="/dummy/create">
 ...
</form>
```

```liquid
<form action="{{ var }}">
 ...
</form>
```

```liquid
<form action="https://example.com/external">
 ...
</form>
```

## Check Options

The default configuration for this check is the following:

```yaml
FormAction:
  enabled: true
```

## When Not To Use It

There should be no cases where disabling this rule is needed.

## Version

This check has been introduced in PlatformOS Check 0.4.5.

## Resources

- [Rule Source][codesource]
- [Documentation Source][docsource]

[codesource]: /lib/platformos_check/checks/form_action.rb
[docsource]: /docs/checks/form_action.md

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
platformos-check-0.4.12 docs/checks/form_action.md
platformos-check-0.4.11 docs/checks/form_action.md
platformos-check-0.4.10 docs/checks/form_action.md
platformos-check-0.4.9 docs/checks/form_action.md