mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-12-16 02:14:17 +00:00
first commit of a million rails snippets, conditions missing, command implementation missing...
This commit is contained in:
@@ -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
|
||||
@@ -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"
|
||||
# --
|
||||
7
extras/imported/rails-mode/ERb Templates/end.yasnippet
Normal file
7
extras/imported/rails-mode/ERb Templates/end.yasnippet
Normal file
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: end
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: end (ERB)
|
||||
## condition: "text.html.ruby"
|
||||
# --
|
||||
<% end -%>
|
||||
@@ -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 %>
|
||||
@@ -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
|
||||
@@ -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
|
||||
@@ -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}}}) %>
|
||||
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: mp
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: map(&:sym_proc)
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
map(&:${1:id})
|
||||
@@ -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...}"} %>
|
||||
Reference in New Issue
Block a user