Lazy Rails Developer
The Lazy Rails Developer extension is a collection of useful snippets specifically designed for Ruby on Rails developers. With this extension, you can quickly and easily insert commonly used code snippets into your projects, saving you time and effort.
Snippets binding
Ruby
class
, cla
- New Ruby class.
class $1
def initialize
$0
end
end
begin
, beg
- New Ruby begin block.
begin
$0
end
begin
, begr
- New Ruby begin block with rescue.
begin
$0
rescue $1
end
begin
, begrn
- New Ruby begin block with rescue and ensure.
begin
$0
rescue $1
ensure
end
def
- New Ruby method.
def $1
$0
end
def
, sdef
- New Ruby singleton method
def self.$1
$0
end
each
, ea
- New Ruby inline each loop.
each { |$1| $0 }
each
, eachb
, eab
- New Ruby each loop block.
each do |$1|
$0
end
flat_map
, fmap
- New Ruby inline flat_map loop.
flat_map { |$1| $0 }
flat_map
, fmapb
- New Ruby flat_map loop block.
flat_map do |$1|
$0
end
find
- New Ruby inline find loop.
find { |$1| $0 }
findb
- New Ruby find loop block.
find do |$1
$0
end
for
- New Ruby for loop.
for $1 in $2
$0
end
map
- New Ruby inline map loop.
map { |$1| $0 }
mapb
- New Ruby map loop block.
map do |$1|
$0
end
module
, mod
- New Ruby module.
module $1
def $2
$0
end
end
select
, sl
- New Ruby inline select loop.
select { |$1| $0 }
select
, slb
- New Ruby select loop block.
select do |$1|
$0
end
until
, unt
- New Ruby until loop.
until $1
$0
end
while
, wh
- New Ruby while loop.
while $1
$0
end
ActiveRecord
find
, rfind
, rf
- New ActiveRecord find.
find($1)
find_by
, rfb
- New ActiveRecord find_by.
find_by($1)