热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

Sublimetext2和railshtml。如果还有其他问题的话。-Sublimetext2andrailshtml.erbifthenelseissue

LoveSublimetext2,butsomehowcantgetittodoifthenelseproperlywithinanhtml.erbtempl

Love Sublime text 2, but somehow can't get it to do 'if then else' properly within an html.erb template. It correctly identifies the files as 'HTML (Rails)', but when I do 'if' followed by tab

热爱崇高的文本2,但不知何故,它不能在html中做正确的“if then else”。erb模板。它正确地将文件标识为“HTML (Rails)”,但当我这样做时,它会在“if”之后加上“tab”

I get:

我得到:




I've seen this reported a few other places, but not sure how to fix as new to Sublimetext. Any tips much appreciated

我已经看到了一些其他地方的报道,但不确定如何修复作为新到Sublimetext。任何提示感谢

3 个解决方案

#1


1  

You have php autocomplete there.

这里有php自动完成。

Install ruby and rails plugins for rails development.

为rails开发安装ruby和rails插件。

More at http://linuxrails.blogspot.com/2012/05/sublime-text-2-setup-for-rails.html

更在http://linuxrails.blogspot.com/2012/05/sublime-text-2-setup-for-rails.html

#2


2  

I added a couple of custom snippets to cover if/elsif/else in erb files.

我在erb文件中添加了一些自定义代码片段来覆盖if/elsif/else。

if-erb.sublime-snippet:

if-erb.sublime-snippet:


    ]]>
    if
    text.html.ruby
    if (ERB)

elsif-erb.sublime-snippet

elsif-erb.sublime-snippet


    ]]>
    elsif
    text.html.ruby
    elsif (ERB)

else-erb.sublime-snippet

else-erb.sublime-snippet


    ]]>
    else
    text.html.ruby
    else (ERB)

#3


0  

Well, the only way i could make it work was by deleting the php snippets and adding some of my own.
Steps:
1- Go to Preferences -> Browse Packages.
2- Go inside PHP folder.
3- Delete the else/elsif snippets.
4- Create your own like the following example:

我能让它工作的唯一方法是删除php代码片段并添加一些我自己的代码片段。步骤:1-进入首选项->浏览包。2-进入PHP文件夹。3-删除else/elsif片段。4-创建自己的示例如下:



  ]]>
else
text.html - source


推荐阅读
author-avatar
书友14395217
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有