Sourabh Upadhyay
Sourabh Upadhyay

Reputation: 1044

Access wrapper app assets file to engine in rails3

I am creating a rails engine inside a rails app. I have a test.js file in rails app and I want to include this file in my rails engine's application.js file. My engine is in vendor/engines folder. How can I include wrapper(main) app's assets file into engine?

I am new for rails engine. If I miss something please let me know.

Upvotes: 1

Views: 53

Answers (1)

Vinay
Vinay

Reputation: 334

If I am getting you right then you want some DRY code for using same js file in different places.

Rails starts looking from the root directory. So you just need to require the js file same as you did in application.js.

For example

//= require test

Upvotes: 1

Related Questions