# Redbox - implementation

**URL:** <https://www.ruby-forum.com/t/redbox-implementation/108903>\
**Category:** Rails\
**Created:** [July 9, 2007, 6:38am UTC](https://www.ruby-forum.com/t/redbox-implementation/108903 "2007-07-09T06:38:39Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jacobnelson79](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ad7895/32.png) [@jacobnelson79](https://www.ruby-forum.com/u/jacobnelson79)\
**Post date:** [July 9, 2007, 6:38am UTC](https://www.ruby-forum.com/t/redbox-implementation/108903/1 "2007-07-09T06:38:39Z")

</div>

Step 1:  
1.1: download all the files from the link  
“[http://www.craigambrose.com/projects/redbox](http://www.craigambrose.com/projects/redbox)” and save it in the folder  
“redbox”

```
 1.2: create a folder named "redbox" in "vendor/plugins" and save

```

the file “init.rb” in “vendor/plugins/redbox”  
1.3: save the “redbox.js” file inside the folder  
“public/javascripts”  
1.4: save the “redbox.css” file inside the folder  
“public/stylesheets”  
1.5: save the “redbox\_spinner.gif” file inside the folder  
“public/images”

Step 2:  
2.1: include the javscript file in your rhtml using the command  
\<%= javascript\_include\_tag :defaults %\>  
\<%= javascript\_include\_tag ‘redbox’ %\>  
2.2: include the stylesheet using the command  
\<%= stylesheet\_link\_tag ‘redbox’ %\>

Now you are ready to use the RedBox in your application.

You can include a Redbox using three ways

1. Inline Redbox :- This box is already somewhere in this page, but is  
hidden, and is specified using it’s id attribute.

\<%=link\_to\_redbox(‘Inline Red Box’, ‘inline\_box’, {:complete =\>  
‘inline\_box’, :loading =\> visual\_effect(:highlight, ‘inline\_box’)}) %\>

This is an Inline Redbox.

1. Inline redbox generated by a component :- This box is generated by  
another action, just like a remote redbox, however it is rendered into  
this page so that it behaves like an inline redbox. This removes the  
load time when the box is opened, however it slows down the initial page  
load.

\<%= link\_to\_component\_redbox(“Red Box Component Contact Page”, :action  
=\> “contact”) %\>

1. AJAX redbox

\<%= link\_to\_remote\_redbox(“Red Box Ajax Contact Page”, :url =\> {:action  
=\> “contact”}) %\>

## Command to close the Redbox

\<%= link\_to\_close\_redbox(‘Close’)%\>

---

<div class="post-metadata">

**Author:** ![jacobnelson79](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/ad7895/32.png) [@jacobnelson79](https://www.ruby-forum.com/u/jacobnelson79)\
**Post date:** [July 16, 2007, 10:34pm UTC](https://www.ruby-forum.com/t/redbox-implementation/108903/2 "2007-07-16T22:34:12Z")

</div>

I’m new to Redbox but have it working in my application. However, on  
pages that have less than a full page length of content the overlay  
only goes down as far as the content. I’ve used other lightboxes  
before outside of Rails and have never had this problem. Has anyone  
else experienced this? …overcome this?

On Jul 8, 10:38 pm, Jacob N. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)
