summaryrefslogtreecommitdiff
path: root/snippets/eelixir.snippets
blob: c15d86ec66a0e0a50e2deff946a95d83e47b927d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
extends html

snippet % <% %>
	<% ${0} %>
snippet = <%= %>
	<%= ${0} %>
snippet # <%# %>
	<%# ${0} %>
snippet end
	<% end %>
snippet for
	<%= for ${1:item} <- ${2:items} ${3:@conn} do %>
		${0}
	<% end %>
snippet if
	<%= if ${1} do %>
		${0:${VISUAL}}
	<% end %>
snippet ife
	<%= if ${1} do %>
		${2:${VISUAL}}
	<% else %>
		${0}
	<% end %>
snippet cond
	<%= cond do %>
		<% ${1} -> %>
			${2:${VISUAL}}

		<% true -> %>
			${0}
	<% end %>
snippet unless
	<%= unless ${1} do %>
		${0:${VISUAL}}
	<% end %>
snippet ft form_tag
	<%= form_tag(${1:"/users"}, method: ${2::post}) %>
		${0}
	</form>

snippet sl select
	<%= select ${1:f}, :${2:field}, ${3:[{"key", "value"}]}, prompt: ${4:"Prompt"} %>

snippet sb submit
	<%= submit ${1:"Submit"} %>

snippet rb radio_button
	<%= radio_button ${1:f}, :${2:field},  ${3:"value"} %>


snippet et error_tag
	<%= error_tag ${1:f}, :${2:field} %>
snippet ti text_input
	<%= text_input ${1:f}, :${2:field} %>
snippet la label
	<%= label ${1:f}, :${2:field}, "${3:Label}" %>
snippet pi password_input
	<%= password_input ${1:f}, :${2:password} %>
snippet render
	<%= render "${1:index}.html", ${2:var: @var} %>
snippet lin link
	<%= link "${1:Submit}", to: ${2:"/users"}, method: ${3::delete} %>
snippet ff form_for
	<%= form_for @changeset, ${1:"/users"}, fn f -> %>
			${0}

		<%= submit "Submit" %>
	<% end %>
snippet pry
	<% require IEx; IEx.pry %>