1
votes

i've been looking on how to integrate gRaphael with Rails and been using this gem

From the gem i notice it has a class for the Rails Engine:

File graphael-rails.rb

module Graphael
  module Rails
    class Engine < ::Rails::Engine

    end
  end
end

And since the rails guides mention a similar behavior for jquery :

7 Adding Assets to Your Gems Assets can also come from external sources in the form of gems.

A good example of this is the jquery-rails gem which comes with Rails as the standard JavaScript library gem. This gem contains an engine class which inherits from Rails::Engine. By doing this, Rails is informed that the directory for this gem may contain assets and the app/assets, lib/assets and vendor/assets directories of this engine are added to the search path of Sprockets.

I guess the files would be recognized adding //= require Graphael to my application.js, but it seems not, since i'm getting the error message Sprockets::FileNotFound couldn't find file 'Graphael' ...

What might i do for sprockets to recognize gRaphael?

Thank you

1

1 Answers

1
votes

The files are available under raphael according to the gem's directory structure: https://github.com/cschwartz/graphael-rails/tree/master/vendor/assets/javascripts

Try

//= require raphael