views:

286

answers:

2

I've installed FaceboxRender and JQuery and Facebox. Following the instrutions on http://github.com/ihower/facebox_render/

I've tried Facebox alone, in my rails app and it's working. After that I've put the folder facebox_render in vendor/plugins/facebox_render/, I added

include FaceboxRender

in /app/controllers/application.rb restarted my app, then wrote the link:

facebox_link_to "Whatever", :url => whatever_path

but nothing happen when I click.

Any idea?

Thank you

+2  A: 

Have you included the facebox javascripts and css files in the head of your html layout?

<%= javascript_include_tag('jquery', 'facebox') %>
<%= stylesheet_link_tag('facebox') %>

Failing that, are you getting any javascript errors showing up in firebug?

Andrew Nesbitt
A: 

Yes I've included them:

    <%= stylesheet_link_tag "application", "jquery-ui", "map", "facebox", "faceplant" %>
    <%= javascript_include_tag 'jquery', 'jquery.validate', 'facebox', 'application'  %>

and in application.js

jQuery(document).ready(function($) {
  $('a[rel*=facebox]').facebox({
    loading_image : 'loading.gif',
    close_image   : 'closelabel.gif'
  }) 
})

when I click on:

   facebox_link_to "test", :url => '/test/new'

this is what and Firebug's console reports:

$("a[rel*=facebox]").facebox is not a function
anonymous(function())                   applicat...262613317 (line 4)
anonymous()                             jquery.j...260464452 (line 19)
anonymous([function(), function(), function(), 2 more...], function(), Object name=F)                                 jquery.j...260464452 (line 12)
anonymous()                             jquery.j...260464452 (line 19)
anonymous()                             jquery.j...260464452 (line 19)
[Break on this error] close_image : 'closelabel.gif'\n      applicat...262613317 (line 4)
Leonardo Dario Perna
any result, getting same problem....
Angela
nope :-( and you?
Leonardo Dario Perna