Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bootstrap2 dependency patch. Include bootstrap statically to make it possible using bootstrap3 in your local application #1733

Closed

Conversation

bulleric
Copy link

@bulleric bulleric commented Sep 3, 2013

I include bootstrap statically in rails_admin

The following files are not necessary i think because they are not includes in app/assets/stylesheets/rails_admin/rails_admin.scss.erb:

  • bootstrap.css
  • bootstrap.min.css
  • bootstrap-response.css
  • bootstrap-responsive.min.css

In other respects every application wich mount rails_admin will load this static bootstrap files.
Additionally i rename the bootstrap directory to bootstrap2 and adjust all bootstrap includes in assets/stylesheets/rails_admin/rails_admin.scss.erb

I think rails_admin only need the bootstrap directory because rails_admin.scss.erb doesn't include other files.
I think my branch is now stable with that patch and rails applications can be used with bootstrap3.

@caboteria
Copy link
Collaborator

Hi @bulleric, it looks as if there are remaining references to bootstrap that need to be removed before this pull request will merge cleanly. It looks like the one in lib/rails_engine/engine.rb is what's causing travis to stub its toe.

@ghost ghost assigned caboteria Sep 7, 2013
@bensheldon
Copy link
Contributor

Hrm, I'm still getting interference when trying to @import "bootstrap" in the rails app project, expecting bootstrap3, and instead getting the bootstrap2 that's being statically included in this branch of rails_admin. I found that if I had rails_admin listed in my gemfile before bootstrap-sass (:branch => "3"), then I'd get bootstrap3 but rails_admin would throw some css compilation errors; and if I listed rails_admin after bootstrap-sass, I'd get the opposite effect of rails_admin working fine by my application.css.sass file throwing errors. So there is something odd going on with bundler.require and how the assets are being configured that is much beyond my ken.

The working solution I have is renaming the css directory from bootstrap to bootstrap2 and modifying rails_admin to @import "bootstrap2/variables", etc. That branch is here: https://github.com/bensheldon/rails_admin/tree/lock-bootstrap2

I'm opening a pull request to see if it passes travis, so apologies if it's a distraction.

@bensheldon bensheldon mentioned this pull request Sep 9, 2013
remove bootstrap reference from lib/rails_engine/engine.rb
@coveralls
Copy link

Coverage Status

Coverage decreased (-8.34%) when pulling 7272394 on bulleric:bootstrap2-dependency-patch into 8d2a9dc on sferik:master.

@mpgarate
Copy link

bump
Is this issue still under consideration?

@caboteria
Copy link
Collaborator

Not unless the author gets it to merge cleanly.

@bulleric
Copy link
Author

Sry i'm currently really busy. I try to check it next week.

@caboteria
Copy link
Collaborator

Folks, let's not hassle the author, he'll get to it when he gets to it. If you want it sooner, you know what to do...

@jcoleman
Copy link
Contributor

Oddly when you namespace the bootstrap stylesheets folder (whether by renaming the folder directly or by placing it within another folder) and update the rails_admin bootstrap imports to match, tests fail with the error ActionView::Template::Error: File to import not found or unreadable: font-awesome.

If bootstrap isn't namespaced at all, the tests pass but breaks Rails apps because those bootstrap files are available globally thus defeating the whole purpose of this pull request.

Anyone have any thoughts on the mysterious error?

Edit: To see an up-to-date branch demonstrating this issue, you can look at https://github.com/jcoleman/rails_admin/tree/vendorize-bootstrap-2

@jcoleman
Copy link
Contributor

I've fixed the issues I mentioned earlier and created a new pull request: #1799

The new PR correctly namespaces all bootstrap files as well as fixes all tests by including the relevant lib code from the bootstrap-sass gem.

@mshibuya
Copy link
Member

Fixed by #1799.

@mshibuya mshibuya closed this Nov 12, 2013
@chirag7jain
Copy link

@jcoleman tried your suggestion. I am getting this error

undefined method `options=' for true:TrueClass
(in /home/mirraw-dev/.rvm/gems/ruby-1.9.3-p484@mirraw-dev/bundler/gems/rails_admin-f572ce5f080d/app/assets/stylesheets/rails_admin/rails_admin.scss.erb)

under this block in sass gem - sass-3.2.5/lib/sass/engine.rb

@options[:filename] && @options[:importer]
330 key = sassc_key
331 sha = Digest::SHA1.hexdigest(@template)
332
333 if root = @options[:cache_store].retrieve(key, sha)
334 root.options = @options
335 return root
336 end
337 end
338
339 check_encoding!

@jcoleman
Copy link
Contributor

I'm not really setup to test it, but obviously it looks like there's an option that sets to true instead of some correct value.

@chirag7jain
Copy link

@jcoleman I tried looking out for similar issues. most of them suggested clearing railsapp/tmp/cache folder.

I tried doing that 3 three times. the first 2 times i got the same response as earlier then the third time i got error saying that the app/assets/javascripts/rails_admin/ra.i18n.coffee not found. so i just removed the require line for the same file in rails_admin.js and it worked.

Theres something funny about the error

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

Successfully merging this pull request may close these issues.

8 participants