-
Notifications
You must be signed in to change notification settings - Fork 0
/
haml.snip
145 lines (98 loc) · 2.95 KB
/
haml.snip
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
snippet conf
-content_for :${1:yield_label_in_layout} do
${2}
snippet cs
=collection_select :${1:object}, :${2:method}, :${3:collection}, :${4:value_method}, :${5:text_method} ${6:, [options]} ${7:, [html_options]}
snippet ff
-form_for @${1:model} do |f|
${2}
snippet ffcb
=f.check_box :${1:attribute}
snippet ffe
=error_messages_for :${1:model}
-form_for @${2:model} do |f|
${3}
snippet ffff
=f.file_field :${1:attribute}
snippet ffhf
=f.hidden_field :${1:attribute}
snippet ffl
=f.label :${1:attribute}
snippet ffpf
=f.password_field :${1:attribute}
snippet ffrb
=f.radio_button :${1:attribute}, :${2:tag_value}
snippet ffs
=f.submit "<+Submit+>"<+, :disable_with => '<+Submitting+>'+>
snippet ffta
=f.text_area :${1:attribute}
snippet fftf
=f.text_field :${1:attribute}
snippet fields
-fields_for :${1:model}, @$1 do |${2:f}|
${3}
snippet for
-if !${1:list}.blank?
-for ${2:item} in $1
${3}
-else
${4}
snippet ft
-form_tag(<+:action => "<+update+>"+><+, {:<+class+> => "<+form+>"}+>) do
<++>
snippet if
-if ${1}
${2}
snippet ife
-if ${1}
${2}
-else
snippet it
=image_tag "${1}"
snippet jit
=javascript_include_tag <+:all+><+, :cache => <+true+>+>
snippet jsit
=javascript_include_tag "${1}"
snippet lia
=link_to "${1:link text}", :action => "${2:index}"
snippet liai
=link_to "<+link text+>", :action => "<+edit+>", :id => <+@<+item+>+>
snippet lic
=link_to "${1:link text}", :controller => "${2:items}"
snippet lica
=link_to "${1:link text}", :controller => "${2:items}", :action => "${3:index}"
snippet licai
=link_to "<+link text+>", :controller => "<+items+>", :action => "<+edit+>", :id => <+@<+item+>+>
snippet lim
=link_to <+model+>.<+name+>, <+<+model+>_path(<+model+>)+>
snippet linp
=link_to <+"<+link text+>"+>, <+<+parent+>_<+child+>_path(<+@+><+parent+>, <+@+><+child+>)+>
snippet linpp
=link_to <+"<+link text+>"+>, <+<+parent+>_<+child+>_path(<+@+><+parent+>)+>
snippet lip
=link_to <+"<+link text+>"+>, <+<+model+>_path(<+@+><+instance+>)+>
snippet lipp
=link_to <+"<+link text+>"+>, <+<+model+>s_path+>
snippet lt
=link_to "${1}", ${2:dest}
snippet ofcfs
=options_from_collection_for_select <+collection+>, <+value_method+>, <+text_method+><+, <+[selected_value]+>+>
snippet rf
=render :file => "${1:file}"${2}
snippet rp
=render :partial => "${1:file}"${2}
snippet rt
=render :template => "${1:file}"${2}
snippet slt
=stylesheet_link_tag <+:all+><+, :cache => <+true+>+>
snippet sslt
=stylesheet_link_tag "${1}"
snippet st
=submit_tag "<+Save changes+>"<+, :id => "<+submit+>"+><+, :name => "<+submit+>"+><+, :class => "<+form_name+>"+><+, :disabled => <+false+>+><+, :disable_with => "<+Please wait+>"+>
snippet unless
-unless ${1}
${2}
snippet unlesse
-if ${1}
${2}
-else