Skip to content
This repository has been archived by the owner on Jan 6, 2019. It is now read-only.

Add backbone in Rails Engine #67

Open
samarthsikotara opened this issue Jan 22, 2015 · 5 comments
Open

Add backbone in Rails Engine #67

samarthsikotara opened this issue Jan 22, 2015 · 5 comments

Comments

@samarthsikotara
Copy link

I have 2 engines in rails application. I want to add backbone in 1 engine. how to do it? If I run
rails g backbone:install

it will not add backbone to my engine.

@meleyal
Copy link
Owner

meleyal commented Mar 25, 2015

Does this help?
#43

@samarthsikotara
Copy link
Author

@meleyal I have added my coffee script files to my rails engine manually and set path in application.js. I t's working. however I am still finding out Is there any proper way to install backbone directly to my rails engine?

@meleyal
Copy link
Owner

meleyal commented Mar 25, 2015

There's an old pull request that needs some tests, I'd be happy to integrate this if you can take a look?

@samarthsikotara
Copy link
Author

I have already tried this pull request but It creates nil_class.js.coffee in my assets. I couldn't able to look an engine name cpanel.js.coffee file.

@spodlecki
Copy link

@samarthsikotara

as of 1.2.0.0 ( #70 ) allows you to name the app what you wish.

For the shared engines part -- I know in Rails 4, I have to add requires in my engine's main ruby file... this is true for everything. (such as jquery-rails)

ROOT/lib/shared_assets.rb

require "shared_assets/engine"
require 'coffee-rails'
require 'sass-rails'
require 'bootstrap-sass'
require 'jquery-rails'
require 'backbone-on-rails'
require 'requirejs-rails'

module SharedAssets
end

do a bundle on the main app and bundle exec rails g backbone:scaffold Home --app=App

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants