ruby-on-rails – Haml格式化
发布时间:2020-12-17 03:51:26 所属栏目:百科 来源:网络整理
导读:我是haml的新手,所以我还在试图找出格式. 我有一个index.haml文件,其中包含以下代码. %h1 Welcome to SolidarityHello,= @profile.first_name! 它呈现如下: Welcome to Solidarity Hello,user ! 这是页面来源: h1 Welcome to Solidarity/h1Hello,frances!
我是haml的新手,所以我还在试图找出格式.
我有一个index.haml文件,其中包含以下代码. %h1 Welcome to Solidarity Hello,= @profile.first_name ! 它呈现如下:
这是页面来源: <h1> Welcome to Solidarity </h1> Hello,frances ! 它在@ profile.first_name和感叹号之间有一个空格.这是为什么?而且,我该如何解决? 解决方法%h1 Welcome to Solidarity Hello,#{@profile.first_name}! Please #{link_to 'post a comment',new_comment_path}! 变 <h1>Welcome to Solidarity</h1> Hello,John! Please <a href="/comments/new">post a comment</a>! 请记住,在Rails 2和Haml 2中,你必须正确html-escape你发送到浏览器的任何东西(ht nex3): Hello,#{h @profile.first_name}! 在Rails 3和Haml 3中,默认情况下都会转义所有内容,因此您可以执行以下操作: Hello,#{@profile.first_name}! (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 未找到ios – QuartzCore/CAMetalLayer.h文件
- swift – 迭代数组并更新值.错误:’@lvalue $T5’与’Int’
- H5音频<audio/>样式修改,拖拽、点击进度操作,总时长 dur
- ruby-on-rails – Ruby – 如何从ruby上的.pfx文件中提取pu
- Swift中的willSet与didSet
- ruby-on-rails – 如何告诉ActiveRecord不要记录任何控制字
- Vue中render方法的使用详解
- core-data – 将NSSet转换为Swift数组
- cocos2d-x3.2怎么用Eclipse打包
- Flash Professional CS6 安装zxp插件
推荐文章
站长推荐
- Postgresql ALTER语句常用操作小结
- objective-c – UIPageViewController:pageView
- Dreamer2.1 发布 新增将Bean解析成xml和json
- pure actionscript3 button in flex ,
- elf转化成bin后,bin文件变大的问题
- ruby-on-rails – 如何暂时使我的staging rails服
- swift写一个简单的列表unable to dequeue a cell
- 关于solr schema.xml 和solrconfig.xml的解释
- C# 值类型和引用类型的区别
- BlazeDS介绍(http://blog.csdn.net/hgy82/articl
热点阅读