Skip to content

Instantly share code, notes, and snippets.

@emilioeduardob
Created April 20, 2016 18:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emilioeduardob/5679c2995d012e24e055ebed13fc3d5d to your computer and use it in GitHub Desktop.
Save emilioeduardob/5679c2995d012e24e055ebed13fc3d5d to your computer and use it in GitHub Desktop.
My rails snippets for Atom
'.source.ruby':
'Service':
'prefix': 'service'
'body': """
class ${1:ServiceName}
attr_reader :${2:param}
def initialize(${2:param})
@${2:param} = ${2:param}
end
def run
end
end
"""
'Admin':
'prefix': 'admin'
'body': """
ActiveAdmin.register $1 do
permit_params :id
end
"""
'Admin Index':
'prefix': 'admin_index'
'body': """
index do
selectable_column
id_column
column :$1
column :created_at
actions
end
"""
'Admin Show':
'prefix': 'admin_show'
'body': """
show do
attributes_table do
row :$1
end
end
"""
'Admin Form':
'prefix': 'admin_form'
'body': """
form do |f|
f.inputs "Details" do
f.input :$1
end
f.actions
end
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment