1

I've recently switched to Sublime Text 2 for Rails development and I'm trying to understand how to get alternate options for snippets. For example in a rails migration the snippet

mcol + [tab key]

enter image description here

can either remove / add a column. When I tab I get the following output.

remove_column :table, :column [press tab twice to generate add_column]

So there are instructions for tab twice to generate the add_column alternate. I can't for the life of me get the add_column alternate. Does anyone know how this is supposed to work?

Edit: Here is the snippet in question: "Packages/Rails/Migration-Remove-and-Add-Column-(mrac).sublime-snippet"

<snippet>
    <content><![CDATA[remove_column :${1:table}, :${2:column}${3: [press tab twice to generate add_column]}]]></content>
    <tabTrigger>mcol</tabTrigger>
    <scope>meta.rails.migration - meta.rails.migration.create_table - meta.rails.migration.change_table</scope>
    <description>Remove / Add Column</description>
</snippet>

1 Answer 1

0

I'm not sure how that snippet is supposed to work, it may be broken. I would add a snippet for add_column

Tools > New Snippet...

<snippet>
    <content><![CDATA[add_column :${1:table}, :${2:column}]]></content>
    <tabTrigger>acol</tabTrigger>
    <scope>meta.rails.migration - meta.rails.migration.create_table - meta.rails.migration.change_table</scope>
    <description>Add Column</description>
</snippet>

Save as "Migration-Add-Column-(acol).sublime-snippet" in your "Packages/User" folder.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .