Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
157 lines (111 sloc) 3.44 KB
snippet if
<% if ${1:condition} %>
${2}
<% end %>
snippet ife
<% if ${1} %>
${2}
<% else %>
<% end %>
snippet unless
<% unless ${1} %>
${2}
<% end %>
snippet unlesse
<% if ${1} %>
${2}
<% else %>
<% end %>
snippet conf
<% content_for :${1:yield_label_in_layout} do -%>
${2}
<% end -%>
snippet cs
<%= collection_select <+object+>, <+method+>, <+collection+>, <+value_method+>, <+text_method+><+, <+[options]+>, <+[html_options]+>+> %>
snippet ct
<%= content_tag '${1:DIV}', ${2:content}${3:,options} -%>
snippet end
<% end -%>
snippet ff
<% form_for @${1:model} do |f| -%>
${2}
<% end -%>
snippet ffcb
<%= ${1:f}.check_box :${2:attribute} %>
snippet ffe
<% error_messages_for :${1:model} -%>
<% form_for @${2:model} do |f| -%>
${3}
<% end -%>
snippet ffff
<%= ${1:f}.file_field :${2:attribute} %>
snippet ffhf
<%= ${1:f}.hidden_field :${2:attribute} %>
snippet ffl
<%= ${1:f}.label :${2:attribute}, '${3:$2}' %>
snippet ffpf
<%= ${1:f}.password_field :${2:attribute} %>
snippet ffrb
<%= ${1:f}.radio_button :${2:attribute}, :${3:tag_value} %>
snippet ffs
<%= ${1:f}.submit "${2:submit}" %>
snippet ffta
<%= ${1:f}.text_area :${2:attribute} %>
snippet fftf
<%= ${1:f}.text_field :${2:attribute} %>
snippet fields
<% fields_for :${1:model}, @$1 do |${2:f}| -%>
${3}
<% end -%>
snippet for
<% for ${2:item} in ${1:list} -%>
${3}
<% end -%>
snippet ft
<% form_tag(<+:action => "<+update+>"+><+, {:<+class+> => "<+form+>"}+>) do -%>
<++>
<% end -%>
snippet i18
I18n.t('${1:type.key}')${2}
snippet it
<%= image_tag "${1}"${2} %>
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:name}", ${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+>"+> %>