Skip to content

Commit

Permalink
chore: MetaTags docs
Browse files Browse the repository at this point in the history
  • Loading branch information
joelmoss committed Feb 2, 2024
1 parent 7ed2eae commit 1d530fc
Showing 1 changed file with 30 additions and 1 deletion.
31 changes: 30 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,36 @@ Phlexible::Rails::ButtonTo.new(:root, method: :patch) { 'My Button' }
- `:form_attributes` - Hash of HTML attributes for the form tag.
- `:data` - This option can be used to add custom data attributes.
- `:params` - Hash of parameters to be rendered as hidden fields within the form.
- `:method` - Symbol of the HTTP verb. Supported verbs are :post (default), :get, :delete, :patch, and :put.
- `:method` - Symbol of the HTTP verb. Supported verbs are :post (default), :get, :delete, :patch,
and :put.

#### `MetaTags`

A super simple way to define and render meta tags in your Phlex views. Just render the
`Phlexible::Rails::MetaTagsComponent` component in the head element of your page, and define the
meta tags using the `meta_tag` method in your controllers.

```ruby
class MyController < ApplicationController
meta_tag :description, 'My description'
meta_tag :keywords, 'My keywords'
end
```

```ruby
class MyView < Phlex::HTML
def template
html do
head do
render Phlexible::Rails::MetaTagsComponent
end
body do
# ...
end
end
end
end
```

### `AliasView`

Expand Down

0 comments on commit 1d530fc

Please sign in to comment.