---
title: "rubyonrails: 使用lightbox显示图片"
author: "PBFox"
date: "2007-12-19T15:34:00Z"
tags: []
slug: "rubyonrails-lightbox"
draft: false
lastmod: "2007-12-19T15:34:00Z"
id: 479242
url: "https://developerwork.iteye.com/blog/479242"
---

```
1.安装 ruby script/plugin install http://lipsiasoft.googlecode.com/svn/trunk/lightbox_helper
2.装好好把插件包里面的css,图片,javascript放到程序的相应地方
3.在页面中加入 <%= javascript_include_tag :defaults %>  和 <%= stylesheet_link_tag 'lightbox' %>
4.在程序的view中使用：<%= lightbox_link_to "Link Name", "/path/of/your/image.png" %> 
or
<%= lightbox_image_tag("/images/thumb1.png", "/images/image1.jpg", {:class=>"images"}, :title => "This is a test!") %>
就可以了。
```