first commit of a million rails snippets, conditions missing, command implementation missing...

This commit is contained in:
capitaomorte
2009-11-16 07:09:38 +00:00
parent ead36b2544
commit 96b5606d66
213 changed files with 1592 additions and 0 deletions

View File

@@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# key: ft
# contributor: Translated from TextMate Snippet
# name: form_tag
## condition: "text.html.ruby, text.haml"
# --
<% form_tag(${1::action => "${5:update}"}${6:, {:${8:class} => "${9:form}"\}}) do %>
$0
end

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# type: command
# contributor: Translated from TextMate Snippet
# name: Create Partial From Selection
## binding: "^H"
## condition: "source.ruby.rails, text.html.ruby, text.haml"
# --

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# key: end
# contributor: Translated from TextMate Snippet
# name: end (ERB)
## condition: "text.html.ruby"
# --
<% end -%>

View File

@@ -0,0 +1,13 @@
# -*- mode: snippet -*-
# key: for
# contributor: Translated from TextMate Snippet
# name: for loop in rhtml
## condition: "text.html.ruby"
# --
<% if !${1:list}.blank? %>
<% for ${2:item} in ${1} %>
$3
<% end %>
<% else %>
$4
<% end %>

View File

@@ -0,0 +1,11 @@
# -*- mode: snippet -*-
# key: ffe
# contributor: Translated from TextMate Snippet
# name: form_for with errors
## condition: "text.html.ruby, text.haml"
# --
<%= error_messages_for :${1:model} %>
<% form_for @${2:$1} do |f| -%>
$0
end

View File

@@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# key: ff
# contributor: Translated from TextMate Snippet
# name: form_for
## condition: "text.html.ruby, text.haml"
# --
<% form_for @${1:model} do |f| -%>
$0
end

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# key: ist
# contributor: Translated from TextMate Snippet
# name: image_submit_tag
## condition: "text.html.ruby, text.haml"
# --
<%= image_submit_tag("${1:agree.png}"${2:${3:, :id => "${4:${1:$(file-name-sans-extension yas/text)}}"}${5:, :name => "${6:${1:$(file-name-sans-extension yas/text)}}"}${7:, :class => "${8:${1:$(file-name-sans-extension yas/text)}-button}"}${9:, :disabled => ${10:false}}}) %>

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# key: mp
# contributor: Translated from TextMate Snippet
# name: map(&:sym_proc)
## condition: "source.ruby.rails"
# --
map(&:${1:id})

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# key: st
# contributor: Translated from TextMate Snippet
# name: submit_tag
## condition: "text.html.ruby, text.haml"
# --
<%= submit_tag "${1:Save changes}"${2:, :id => "${3:submit}"}${4:, :name => "${5:$3}"}${6:, :class => "${7:form_$3}"}${8:, :disabled => ${9:false}}${10:, :disable_with => "${11:Please wait...}"} %>