1
0
Fork 0
mirror of synced 2024-11-04 08:28:57 -05:00
ultimate-vim/sources_non_forked/vim-snippets/snippets/eruby.snippets

133 lines
3.4 KiB
Text
Raw Normal View History

2012-08-16 23:41:25 -04:00
# .erb and .rhmtl files
# Includes html.snippets
2016-10-02 07:37:21 -04:00
extends html
2012-08-16 23:41:25 -04:00
# Rails *****************************
snippet rc
<% ${0} %>
2012-08-16 23:41:25 -04:00
snippet rce
<%= ${1} %>
2012-08-16 23:41:25 -04:00
snippet %
<% ${0} %>
2012-08-16 23:41:25 -04:00
snippet =
<%= ${1} %>
2012-08-16 23:41:25 -04:00
snippet end
<% end %>
2012-08-16 23:41:25 -04:00
snippet ead
<% ${1}.each do |${2}| %>
${0}
2012-08-16 23:41:25 -04:00
<% end %>
snippet for
<% for ${2:item} in ${1} %>
${0}
2012-08-16 23:41:25 -04:00
<% end %>
snippet rp
2015-12-08 08:20:04 -05:00
<%= render partial: '${0:item}' %>
2012-08-16 23:41:25 -04:00
snippet rpl
2015-12-08 08:20:04 -05:00
<%= render partial: '${1:item}', locals: { :${2:name} => '${3:value}'${0} } %>
2012-08-16 23:41:25 -04:00
snippet rps
2015-12-08 08:20:04 -05:00
<%= render partial: '${1:item}', status: ${0:500} %>
2012-08-16 23:41:25 -04:00
snippet rpc
2015-12-08 08:20:04 -05:00
<%= render partial: '${1:item}', collection: ${0:items} %>
2012-08-16 23:41:25 -04:00
snippet lia
2015-12-08 08:20:04 -05:00
<%= link_to '${1:link text...}', action: '${0:index}' %>
2012-08-16 23:41:25 -04:00
snippet liai
2015-12-08 08:20:04 -05:00
<%= link_to '${1:link text...}', action: '${2:edit}', id: ${0:@item} %>
2012-08-16 23:41:25 -04:00
snippet lic
2015-12-08 08:20:04 -05:00
<%= link_to '${1:link text...}', controller: '${0:items}' %>
2012-08-16 23:41:25 -04:00
snippet lica
2015-12-08 08:20:04 -05:00
<%= link_to '${1:link text...}', controller: '${2:items}', action: '${0:index}' %>
2012-08-16 23:41:25 -04:00
snippet licai
2015-12-08 08:20:04 -05:00
<%= link_to '${1:link text...}', controller: '${2:items}', action: '${3:edit}', id: ${0:@item} %>
2012-08-16 23:41:25 -04:00
snippet yield
<%= yield ${1::content_symbol} %>
2012-08-16 23:41:25 -04:00
snippet conf
<% content_for :${1:head} do %>
${0}
2012-08-16 23:41:25 -04:00
<% end %>
snippet cs
<%= collection_select <+object+>, <+method+>, <+collection+>, <+value_method+>, <+text_method+><+, <+[options]+>, <+[html_options]+>+> %>
snippet ct
<%= content_tag '${1:DIV}', ${2:content}${0:,options} %>
2012-08-16 23:41:25 -04:00
snippet ff
2013-04-26 12:17:22 -04:00
<%= form_for @${1:model} do |f| %>
${0}
2012-08-16 23:41:25 -04:00
<% end %>
2013-07-17 19:06:05 -04:00
snippet ffi
<%= ${1:f}.input :${0:attribute} %>
2012-08-16 23:41:25 -04:00
snippet ffcb
<%= ${1:f}.check_box :${0:attribute} %>
2012-08-16 23:41:25 -04:00
snippet ffe
<% error_messages_for :${1:model} %>
2013-04-26 12:17:22 -04:00
<%= form_for @${2:model} do |f| %>
${0}
2012-08-16 23:41:25 -04:00
<% end %>
snippet ffff
<%= ${1:f}.file_field :${0:attribute} %>
2012-08-16 23:41:25 -04:00
snippet ffhf
<%= ${1:f}.hidden_field :${0:attribute} %>
2012-08-16 23:41:25 -04:00
snippet ffl
<%= ${1:f}.label :${2:attribute}, '${0:$2}' %>
2012-08-16 23:41:25 -04:00
snippet ffpf
<%= ${1:f}.password_field :${0:attribute} %>
2012-08-16 23:41:25 -04:00
snippet ffrb
<%= ${1:f}.radio_button :${2:attribute}, :${0:tag_value} %>
2012-08-16 23:41:25 -04:00
snippet ffs
<%= ${1:f}.submit "${0:submit}" %>
2012-08-16 23:41:25 -04:00
snippet ffta
<%= ${1:f}.text_area :${0:attribute} %>
2012-08-16 23:41:25 -04:00
snippet fftf
<%= ${1:f}.text_field :${0:attribute} %>
2012-08-16 23:41:25 -04:00
snippet fields
2013-04-26 12:17:22 -04:00
<%= fields_for :${1:model}, @$1 do |${2:f}| %>
${0}
2012-08-16 23:41:25 -04:00
<% end %>
snippet i18
I18n.t('${1:type.key}')
2012-08-16 23:41:25 -04:00
snippet it
<%= image_tag "${1}"${0} %>
2012-08-16 23:41:25 -04:00
snippet jit
<%= javascript_include_tag ${0::all} %>
2012-08-16 23:41:25 -04:00
snippet jsit
<%= javascript_include_tag "${0}" %>
2012-08-16 23:41:25 -04:00
snippet lim
<%= link_to ${1:model}.${2:name}, ${3:$1}_path(${0:$1}) %>
2012-08-16 23:41:25 -04:00
snippet linp
<%= link_to "${1:Link text...}", ${2:parent}_${3:child}_path(${4:@$2}, ${0:@$3}) %>
2012-08-16 23:41:25 -04:00
snippet linpp
<%= link_to "${1:Link text...}", ${2:parent}_${3:child}_path(${0:@$2}) %>
2012-08-16 23:41:25 -04:00
snippet lip
<%= link_to "${1:Link text...}", ${2:model}_path(${0:@$2}) %>
2012-08-16 23:41:25 -04:00
snippet lipp
<%= link_to "${1:Link text...}", ${0:model}s_path %>
2012-08-16 23:41:25 -04:00
snippet lt
<%= link_to "${1:name}", ${0:dest} %>
2013-08-03 08:50:12 -04:00
snippet ntc
<%= number_to_currency(${1}) %>
2012-08-16 23:41:25 -04:00
snippet ofcfs
<%= options_from_collection_for_select ${1:collection}, ${2:value_method}, ${3:text_method}, ${0:selected_value} %>
2014-04-18 08:58:02 -04:00
snippet ofs
<%= options_for_select ${1:collection}, ${2:value_method} %>
2012-08-16 23:41:25 -04:00
snippet rf
2015-12-08 08:20:04 -05:00
<%= render file: "${1:file}"${0} %>
2012-08-16 23:41:25 -04:00
snippet rt
2015-12-08 08:20:04 -05:00
<%= render template: "${1:file}"${0} %>
2012-08-16 23:41:25 -04:00
snippet slt
2015-12-08 08:20:04 -05:00
<%= stylesheet_link_tag ${1::all}, cache: ${0:true} %>
2012-08-16 23:41:25 -04:00
snippet sslt
<%= stylesheet_link_tag "${0}" %>
2013-07-17 19:06:05 -04:00
snippet if
<% if ${1} %>
2017-02-11 08:01:38 -05:00
${0:${VISUAL}}
2013-07-17 19:06:05 -04:00
<% end %>
snippet ife
<% if ${1} %>
${2}
<% else %>
${0}
2013-07-17 19:06:05 -04:00
<% end %>
snippet pry
2014-10-31 17:30:24 -04:00
<% require 'pry'; binding.pry %>