-
Notifications
You must be signed in to change notification settings - Fork 27
/
eruby-rails_view.snippets
59 lines (53 loc) · 1.31 KB
/
eruby-rails_view.snippets
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
# Rails View
snippet h
<%= h ${1} %>
snippet contf
<% content_for :${1:yield_label_in_layout} do -%>
${2}
<% end -%>
# form
snippet ff
<% form_for @${1:model} do |f| -%>
<%= f.error_messages %>
<%= f.submit "${2:button}" %>
<% end -%>
snippet ffff
<%= f.file_field :${1:attribute} %>
snippet ffhf
<%= f.hidden_field :${1:attribute} %>
snippet ffl
<%= f.label :${1:attribute}, '${2:label}' %>
snippet ffpf
<%= f.password_field :${1:attribute} %>
snippet ffrb
<%= f.radio_button :${1:attribute}, :${2:tag_value} %>
snippet ffs
<%= f.submit "${1:Submit}" %>
snippet ffta
<%= f.text_area :${1:attribute} %>
snippet fftf
<%= f.text_field :${1:attribute} %>
snippet fieldsf
<% fields_for :${1:model}, @${2:model} do |f| -%>
${3}
<% end -%>
snippet formt
<% form_tag(:action => "${1:action}") do -%>
${2}
<% end -%>
snippet =jsit
<%= javascript_include_tag('${1:javascript_filename}') %>
snippet =sslt
<%= stylesheet_link_tag "${1:stylesheet_filename}" %>
snippet imaget
<%= image_tag "${1:image_path}" %>
snippet lt
<%= link_to '${1:caption}', ${2:path} %>
snippet ltp
<%= link_to '${1:caption}', ${2:model}_path(@${3:instance}) %>
snippet ltpp
<%= link_to '${1:caption}', ${2:model}s_path %>
snippet renderp
<%= render :partial => '${1:partial}' %>
snippet rendert
<%= render :template => "${1:file}" %>