rails image_tag生成图片标签
来源:互联网 发布:python heatmap 编辑:程序博客网 时间:2024/06/05 07:30
image_tag(source, options={})Link
Returns an HTML image tag for thesource
. Thesource
can be a full path or a file.
Options
You can add HTML attributes using theoptions
. Theoptions
supports three additionalkeys for convenience and conformance:
:alt
- If no alt text is given, the file name part of thesource
is used (capitalized and without the extension):size
- Supplied as "{Width}x{Height}" or "{Number}", so"30x45" becomes width="30" and height="45", and "50" becomes width="50" andheight="50".:size
will be ignored if the value is not in thecorrect format.
Examples
image_tag("icon")# => <img alt="Icon" src="/assets/icon" />image_tag("icon.png")# => <img alt="Icon" src="/assets/icon.png" />image_tag("icon.png", size: "16x10", alt: "Edit Entry")# => <img src="/assets/icon.png" width="16" height="10" alt="Edit Entry" />image_tag("/icons/icon.gif", size: "16")# => <img src="/icons/icon.gif" width="16" height="16" alt="Icon" />image_tag("/icons/icon.gif", height: '32', width: '32')# => <img alt="Icon" height="32" src="/icons/icon.gif" width="32" />image_tag("/icons/icon.gif", class: "menu_icon")# => <img alt="Icon" class="menu_icon" src="/icons/icon.gif" />
- rails image_tag生成图片标签
- rails image_tag生成图片标签
- rails 创建html中的image标签 image_tag
- rails 创建html中的image标签 image_tag
- Rails中引用图片问题(image_tag)
- Rails中的image_tag 辅助方法
- rails 标签title换行
- rails标签值content_tag
- rails 生成jquery ajax
- Rails生成EXT Tree
- python中文分词,生成标签云,生成指定形状图片标签云
- rails image 处理图片
- Rails 上传图片
- 利用Rails Freeze生成本地Rails Doc
- JS实现多图片上传,无插件,动态生成标签
- 自助生成rails api 文档
- Ruby On Rails生成二维码
- 图片标签
- 利用DataTable一次性将数据插入到数据库中
- ubuntu终端常用命令
- 禁用cvNamedWindow所创建窗口的系统菜单关闭按钮
- HDU4633 Who's Aunt Zhang
- jsmart异常处理
- rails image_tag生成图片标签
- 了解运算器
- Twitter Bootstrap深受开发者喜爱的11大理由
- 学习的动力系统
- PAT_1039: Course List for Student
- ubuntu远程桌面
- DataGridView绘制序号!
- 软件测试实验学习笔记系列6--图形界面测试(GUI)
- windows窗口关闭的消息响应机制