imagePath in Rails App

0 views
Skip to first unread message

chrise

unread,
Jul 22, 2010, 8:05:31 AM7/22/10
to Qutensil
Hi,

trying to use the Q.Tooltip in my Rails application but I'm getting
some trouble with the imagePath which not points to /images/q but
to /:controller/:id/images/q e.g. /issues/2/images/q/default-dark.png
and that results in a RoutingError in the Rails app.

I just put:

<%= javascript_include_tag "q.full" %>

inside html-head's and init q-tip:

document.observe('q:loaded', function() {
new Q.Tooltip();
});

Gave my element a title attribute and a class "q-tip". The tooltip
appears but loading the images provides the RoutingError descripted
above.
Is this a Rails specific problem or how is Qutensil building the
imagePath?

Thx,
chrise

wonderingwout

unread,
Jul 22, 2010, 8:16:52 AM7/22/10
to Qutensil
Hi Chrise,

Probably a relative path is defined.
Try configuring the image path like this:

document.observe('q:loaded', function() {
Q.set({ imagePath: "/images/q" });
new Q.Tooltip();
});

The Q.set function should only be used once and preferably before any
other Q related actions.
And of course copy the 'q' image folder to the images folder in public
of your rails app, but you probably have done that already.

For more info check the Q.Core page: http://qutensil.cktail.com/pages/qbase
Head over to the "Q's configuration" section for your question.

Regards.
Wout

chrise

unread,
Jul 22, 2010, 9:58:08 AM7/22/10
to Qutensil
Yeah, that's it. Thanks for the quick help.
The Q.Core page was my missing link.
Reply all
Reply to author
Forward
0 new messages