-
-
Save rochefort/1195136 to your computer and use it in GitHub Desktop.
textmate_snippets
This file contains 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
# -*- coding: UTF-8 -*- |
This file contains 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
<p> | |
${TM_RAILS_TEMPLATE_START_RUBY_INLINE}f.label :${1:attribute}${TM_RAILS_TEMPLATE_END_RUBY_EXPR}<br /> | |
${TM_RAILS_TEMPLATE_START_RUBY_EXPR}f.text_field :${1:attribute}${TM_RAILS_TEMPLATE_END_RUBY_EXPR} | |
</p> |
This file contains 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
${TM_RAILS_TEMPLATE_START_RUBY_INLINE}form_for @${1:model} do |f|${TM_RAILS_TEMPLATE_END_RUBY_INLINE} | |
${TM_RAILS_TEMPLATE_START_RUBY_INLINE}if @${1:model}.errors.any?${TM_RAILS_TEMPLATE_END_RUBY_EXPR} | |
<div class="error_messages"> | |
<h2>${2:Form is invalid}</h2> | |
<ul> | |
${TM_RAILS_TEMPLATE_START_RUBY_INLINE}for message in @${1:model}.errors.full_messages${TM_RAILS_TEMPLATE_END_RUBY_EXPR} | |
<li><%= message %></li> | |
${TM_RAILS_TEMPLATE_START_RUBY_INLINE}end${TM_RAILS_TEMPLATE_END_RUBY_EXPR} | |
</ul> | |
</div> | |
${TM_RAILS_TEMPLATE_START_RUBY_INLINE}end${TM_RAILS_TEMPLATE_END_RUBY_EXPR} | |
<p class="button"><%= f.submit %></p> | |
${TM_RAILS_TEMPLATE_END_RUBY_BLOCK} |
This file contains 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
${TM_RAILS_TEMPLATE_START_RUBY_EXPR}form_tag ${1} do${TM_RAILS_TEMPLATE_END_RUBY_EXPR} | |
<p class="button">${TM_RAILS_TEMPLATE_START_RUBY_EXPR}submit_tag${TM_RAILS_TEMPLATE_END_RUBY_EXPR}</p> | |
${TM_RAILS_TEMPLATE_END_RUBY_BLOCK} |
This file contains 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
${TM_RAILS_TEMPLATE_START_RUBY_EXPR}if ${1:condition}${TM_RAILS_TEMPLATE_END_RUBY_EXPR} | |
$2 | |
${TM_RAILS_TEMPLATE_START_RUBY_INLINE}else${TM_RAILS_TEMPLATE_END_RUBY_EXPR} | |
$3 | |
${TM_RAILS_TEMPLATE_START_RUBY_INLINE}end${TM_RAILS_TEMPLATE_END_RUBY_EXPR} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment