Created
April 20, 2016 18:17
-
-
Save emilioeduardob/5679c2995d012e24e055ebed13fc3d5d to your computer and use it in GitHub Desktop.
My rails snippets for Atom
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'.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