2

how do I use facebox in a Rails app knowing that I already have the jquery-rails gem installed? Need sample code that goes into the view as well. Thanks.

Gaelle
  • 599
  • 2
  • 6
  • 24

1 Answers1

3

Include facebox library in your application.html.erb file.

Add this code in a javascript file.

jQuery(document).ready(function($) {
  $('a[rel*=facebox]').facebox() 
})

View

<a href="images/stairs.jpg" rel="facebox">text</a>

There are a few simple examples and some documentation on their site https://github.com/defunkt/facebox#usage.

mrzasa
  • 22,895
  • 11
  • 56
  • 94
suren
  • 969
  • 4
  • 22