mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-10-14 05:23:04 +00:00
first commit of a million rails snippets, conditions missing, command implementation missing...
This commit is contained in:
parent
ead36b2544
commit
96b5606d66
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: crw
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: cattr_accessor
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
cattr_accessor :${0:attr_names}
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: mrw
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: mattr_accessor
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
mattr_accessor :${0:attr_names}
|
@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: returning
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: returning do |variable| … end
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
returning ${1:variable} do${2:$(if (string= "" yas/text) "" " |")}${2:v}${2:$(if (string= "" yas/text) "" "|")}
|
||||
$0
|
||||
end
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: xdelete
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: xhr delete
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
xhr :delete, :${1:destroy}, :id => ${2:1}$0
|
7
extras/imported/rails-mode/Ajax Tests/xhr get.yasnippet
Normal file
7
extras/imported/rails-mode/Ajax Tests/xhr get.yasnippet
Normal file
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: xget
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: xhr get
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
xhr :get, :${1:show}${2:, :id => ${3:1}}$0
|
7
extras/imported/rails-mode/Ajax Tests/xhr post.yasnippet
Normal file
7
extras/imported/rails-mode/Ajax Tests/xhr post.yasnippet
Normal file
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: xpost
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: xhr post
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
xhr :post, :${1:create}, :${2:object} => { $3 }
|
7
extras/imported/rails-mode/Ajax Tests/xhr put.yasnippet
Normal file
7
extras/imported/rails-mode/Ajax Tests/xhr put.yasnippet
Normal file
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: xput
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: xhr put
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
xhr :put, :${1:update}, :id => ${2:1}, :${3:object} => { $4 }$0
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: bt
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: belongs_to
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
belongs_to :${1:object}${2:, :class_name => "${3:${1:$(replace-regexp-in-string "_" "" (capitalize yas/text))}}", :foreign_key => "${4:$1_id}"}
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: habtm
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: has_and_belongs_to_many
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
has_and_belongs_to_many :${1:object}${2:, :join_table => "${3:table_name}", :foreign_key => "${4:$1_id}"}
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: hm
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: has_many
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
has_many :${1:object}s${2:, :class_name => "${1}", :foreign_key => "${4:reference}_id"}
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: hmt
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: has_many (through)
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
has_many :${1:objects}, :through => :${2:join_association}${3:, :source => :${4:$2_table_foreign_key_to_$1_table}}
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: hmd
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: has_many :dependent => :destroy
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
has_many :${1:object}s${2:, :class_name => "$1", :foreign_key => "${4:reference}_id"}, :dependent => :destroy$0
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: ho
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: has_one
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
has_one :${1:object}${2:, :class_name => "${3:${1/[[:alpha:]]+|(_)/(?1::\u$0)/g}}", :foreign_key => "${4:${1}_id}"}
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: aftc
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: after_create
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
after_create
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: aftd
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: after_destroy
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
after_destroy
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: afts
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: after_save
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
after_save
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: aftu
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: after_update
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
after_update
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: aftv
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: after_validation
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
after_validation
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: aftvoc
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: after_validation_on_create
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
after_validation_on_create
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: aftvou
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: after_validation_on_update
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
after_validation_on_update
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: befc
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: before_create
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
before_create
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: befd
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: before_destroy
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
before_destroy
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: befs
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: before_save
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
before_save
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: befu
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: before_update
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
before_update
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: befv
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: before_validation
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
before_validation
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: befvoc
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: before_validation_on_create
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
before_validation_on_create
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: befvou
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: before_validation_on_update
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
before_validation_on_update
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: tre
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Table column(s) rename
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.rename(:${1:old_column_name}, :${2:new_column_name})
|
||||
$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: t.
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: t.rename (tre)
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.rename(:${1:old_column_name}, :${2:new_column_name})
|
||||
t.$0
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: mcol
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Remove / Add Column
|
||||
## condition: "meta.rails.migration - meta.rails.migration.create_table - meta.rails.migration.change_table"
|
||||
# --
|
||||
remove_column :${1:table}, :${2:column}${3: [press tab twice to generate add_column]}
|
@ -0,0 +1,16 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: cla
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Create controller class
|
||||
## condition: "source.ruby"
|
||||
# --
|
||||
class ${1:Model}Controller < ApplicationController
|
||||
before_filter :find_${2:model}
|
||||
|
||||
$0
|
||||
|
||||
private
|
||||
def find_${2}
|
||||
@$2 = ${3:$1}.find(params[:id]) if params[:id]
|
||||
end
|
||||
end
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: flash
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: flash[…]
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
flash[:${1:notice}] = "${2:Successfully created...}"$0
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: verify
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: verify — render
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
verify :only => [:$1], :method => :post, :render => {:status => 500, :text => "use HTTP-POST"}
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: verify
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: verify — redirect
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
verify :only => [:$1], :session => :user, :params => :id, :redirect_to => {:action => '${2:index}'}
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: tcbi
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Table column binary
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.binary :${1:title}${2:, :limit => ${3:2}.megabytes}
|
||||
$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: tcb
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Table column boolean
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.boolean :${1:title}
|
||||
$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: tcda
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Table column date
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.date :${1:title}
|
||||
$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: tcdt
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Table column datetime
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.datetime :${1:title}
|
||||
$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: tcd
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Table column decimal
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.decimal :${1:title}${2:${3:, :precision => ${4:10}}${5:, :scale => ${6:2}}}
|
||||
$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: tcf
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Table column float
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.float :${1:title}
|
||||
$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: tci
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Table column integer
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.integer :${1:title}
|
||||
$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: tcl
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Table column lock_version
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.integer :lock_version, :null => false, :default => 0
|
||||
$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: tcr
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Table column(s) references
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.references :${1:taggable}${2:, :polymorphic => ${3:{ :default => '${4:Photo}' \}}}
|
||||
$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: tcs
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Table column string
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.string :${1:title}
|
||||
$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: tct
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Table column text
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.text :${1:title}
|
||||
$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: tcti
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Table column time
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.time :${1:title}
|
||||
$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: tcts
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Table column timestamp
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.timestamp :${1:title}
|
||||
$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: tctss
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Table column timestamps
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.timestamps
|
||||
$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: t.
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: t.binary (tcbi)
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.binary :${1:title}${2:, :limit => ${3:2}.megabytes}
|
||||
t.$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: t.
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: t.boolean (tcb)
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.boolean :${1:title}
|
||||
t.$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: t.
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: t.date (tcda)
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.date :${1:title}
|
||||
t.$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: t.
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: t.datetime (tcdt)
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.datetime :${1:title}
|
||||
t.$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: t.
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: t.decimal (tcd)
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.decimal :${1:title}${2:${3:, :precision => ${4:10}}${5:, :scale => ${6:2}}}
|
||||
t.$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: t.
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: t.float (tcf)
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.float :${1:title}
|
||||
t.$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: t.
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: t.integer (tci)
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.integer :${1:title}
|
||||
t.$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: t.
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: t.lock_version (tcl)
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.integer :lock_version, :null => false, :default => 0
|
||||
t.$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: t.
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: t.references (tcr)
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.references :${1:taggable}${2:, :polymorphic => ${3:{ :default => '${4:Photo}' \}}}
|
||||
t.$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: t.
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: t.string (tcs)
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.string :${1:title}
|
||||
t.$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: t.
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: t.text (tct)
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.text :${1:title}
|
||||
t.$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: t.
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: t.time (tcti)
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.time :${1:title}
|
||||
t.$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: t.
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: t.timestamp (tcts)
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.timestamp :${1:title}
|
||||
t.$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: t.
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: t.timestamps (tctss)
|
||||
## condition: "meta.rails.migration.create_table, meta.rails.migration.change_table"
|
||||
# --
|
||||
t.timestamps
|
||||
t.$0
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# type: command
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Dump DB to schema.rb
|
||||
## binding: "^|"
|
||||
## condition: "source.ruby.rails, source.yaml"
|
||||
# --
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# type: command
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Load schema.rb to DB
|
||||
## binding: "^|"
|
||||
## condition: "source.ruby.rails, source.yaml"
|
||||
# --
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# type: command
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Migrate to Current
|
||||
## binding: "^|"
|
||||
## condition: "source.ruby.rails, source.yaml"
|
||||
# --
|
@ -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...}"} %>
|
7
extras/imported/rails-mode/Finders/find(3Aall).yasnippet
Normal file
7
extras/imported/rails-mode/Finders/find(3Aall).yasnippet
Normal file
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: fina
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: find(:all)
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
find(:all${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]})
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: finf
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: find(:first)
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
find(:first${1:, :conditions => ['${2:${3:field} = ?}', ${5:true}]})
|
7
extras/imported/rails-mode/Finders/find(id).yasnippet
Normal file
7
extras/imported/rails-mode/Finders/find(id).yasnippet
Normal file
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: fini
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: find(id)
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
find(${1:id})
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: fi
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: <%= Fixtures.identify(:symbol) %>
|
||||
## condition: "source.yaml"
|
||||
# --
|
||||
<%= Fixtures.identify(:${1:name}) %>$0
|
7
extras/imported/rails-mode/Fixtures/LABEL.yasnippet
Normal file
7
extras/imported/rails-mode/Fixtures/LABEL.yasnippet
Normal file
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: $L
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: $LABEL
|
||||
## condition: "source.yaml"
|
||||
# --
|
||||
\$LABEL
|
@ -0,0 +1,11 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: cla
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Create functional test class
|
||||
## condition: "source.ruby"
|
||||
# --
|
||||
require File.dirname(__FILE__) + '/../test_helper'
|
||||
|
||||
class ${1:Model}ControllerTest < ActionController::TestCase
|
||||
deft$0
|
||||
end
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: art
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: assert_redirected_to
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
assert_redirected_to ${2::action => "${1:index}"}
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: asre
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: assert_response
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
assert_response :${1:success}, @response.body$0
|
@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: asg
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: assert(var = assigns(:var))
|
||||
## condition: "source.ruby"
|
||||
# --
|
||||
assert(${1:var} = assigns(:$1), "Cannot find @$1")
|
||||
$0
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: artnpp
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: assert_redirected_to (nested path plural)
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
assert_redirected_to ${10:${2:parent}_${3:child}_path(${4:@}${5:$2})}
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: artnp
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: assert_redirected_to (nested path)
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
assert_redirected_to ${2:${12:parent}_${13:child}_path(${14:@}${15:$12}, ${16:@}${17:$13})}
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: artpp
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: assert_redirected_to (path plural)
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
assert_redirected_to ${10:${2:model}s_path}
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: artp
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: assert_redirected_to (path)
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
assert_redirected_to ${2:${12:model}_path(${13:@}${14:$12})}
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: asrj
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: assert_rjs
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
assert_rjs :${1:replace}, ${2:"${3:dom id}"}
|
@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: ass
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: assert_select
|
||||
## condition: "source.ruby.rails"
|
||||
# --
|
||||
assert_select '${1:path}'${2:, :${3:text} => ${4:'${5:inner_html}'}}${6: do
|
||||
$0
|
||||
end}
|
@ -0,0 +1,12 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: deftg
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: def test_should_get_action
|
||||
## condition: "meta.rails.functional_test"
|
||||
# --
|
||||
def test_should_get_${1:action}
|
||||
${2:@${3:model} = ${4:$3s}(:${5:fixture_name})
|
||||
}get :${1}${6:, :id => @$3.to_param}
|
||||
assert_response :success
|
||||
$0
|
||||
end
|
@ -0,0 +1,12 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: deftp
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: def test_should_post_action
|
||||
## condition: "meta.rails.functional_test"
|
||||
# --
|
||||
def test_should_post_${1:action}
|
||||
${3:@$2 = ${4:$2s}(:${5:fixture_name})
|
||||
}post :${1}${6:, :id => @$2.to_param}, :${2:model} => { $0 }
|
||||
assert_response :redirect
|
||||
|
||||
end
|
7
extras/imported/rails-mode/Generate.yasnippet
Normal file
7
extras/imported/rails-mode/Generate.yasnippet
Normal file
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# type: command
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Call Generate Script
|
||||
## binding: "^|"
|
||||
## condition: "source.ruby.rails, source.yaml"
|
||||
# --
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# type: command
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Go to Controller
|
||||
## binding: "~$@"
|
||||
## condition: "text.html.ruby, source.ruby.rails.embedded.html, meta.rails.helper, meta.rails.functional_test, source.js, source.css, source.yaml, meta.rails.model, meta.rails.unit_test, text.haml"
|
||||
# --
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# type: command
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: File on Current Line
|
||||
## binding: "~@"
|
||||
## condition: "source.ruby.rails, text.html.ruby, source.ruby.rails.embedded.html, text.haml"
|
||||
# --
|
7
extras/imported/rails-mode/Go To/Go To File.yasnippet
Normal file
7
extras/imported/rails-mode/Go To/Go To File.yasnippet
Normal file
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# type: command
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Alternate File
|
||||
## binding: "~@"
|
||||
## condition: "source.ruby.rails, text.html.ruby, source.ruby.rails.embedded.html, source.yaml, text.haml, source.css, source.js, source.sass"
|
||||
# --
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# type: command
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Go to Functional Test
|
||||
## binding: "~$@"
|
||||
## condition: "meta.rails.controller, meta.rails.helper, meta.rails.model, source.yaml, meta.rails.unit_test"
|
||||
# --
|
7
extras/imported/rails-mode/Go To/Go To Helper.yasnippet
Normal file
7
extras/imported/rails-mode/Go To/Go To Helper.yasnippet
Normal file
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# type: command
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Go to Helper
|
||||
## binding: "~$@"
|
||||
## condition: "text.html.ruby, source.ruby.rails.embedded.html, meta.rails.controller, meta.rails.model, meta.rails.unit_test, meta.rails.functional_test, text.haml"
|
||||
# --
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# type: command
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Go to Javascript
|
||||
## binding: "~$@"
|
||||
## condition: "text.html.ruby, source.ruby.rails.embedded.html, meta.rails.controller, meta.rails.helper, text.haml"
|
||||
# --
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# type: command
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Go to Stylesheet
|
||||
## binding: "~$@"
|
||||
## condition: "text.html.ruby, source.ruby.rails.embedded.html, meta.rails.controller, meta.rails.helper, text.haml"
|
||||
# --
|
@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# type: command
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Go to Unit Test
|
||||
## binding: "~$@"
|
||||
## condition: "meta.rails.controller, meta.rails.helper, meta.rails.model, meta.rails.functional_test, source.yaml"
|
||||
# --
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user