You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/components/link.md
+34Lines changed: 34 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -107,3 +107,37 @@ returns
107
107
</a>
108
108
</div>
109
109
```
110
+
111
+
## Example 5 - path from symbol
112
+
This example renders a link with a get request to any within your Rails application. In case you want to switch between pages within one specific matestack app, using the `transition` component probably is a better idea though!
113
+
114
+
```ruby
115
+
div id:"foo", class: "bar"do
116
+
link path::inline_edit_path, text:'Click to edit'
117
+
end
118
+
```
119
+
120
+
returns
121
+
122
+
```html
123
+
<divid="foo"class="bar">
124
+
<ahref="/inline_edit">Click to edit</a>
125
+
</div>
126
+
```
127
+
128
+
## Example 6 - path from symbol with params
129
+
You can also dynamically create `paths` from symbols and params, as displayed below:
130
+
131
+
```ruby
132
+
div id:"foo", class: "bar"do
133
+
link path::single_endpoint_path, params: {number:1}, text:'Call API endpoint 1'
134
+
end
135
+
```
136
+
137
+
returns
138
+
139
+
```html
140
+
<divid="foo"class="bar">
141
+
<ahref="/api/single_endpoint/1">Call API endpoint 1</a>
0 commit comments