Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
146 lines (98 sloc) 2.95 KB
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