Fezvrasta material design for bootstrap: how integrate with rails (SASS) - ruby-on-rails

I'm trying to add Fezvrasta material design for bootstrap to my rails app but unfortunately without success.
Can anyone give me some help on how to do this?
Both rails assets and this SO answer didn't work.
On the first I got the following error message:
File to import not found or unreadable: bootstrap-material-design.
And on the second one this one:
'It's not clear which file to import'
EDIT
so for the first link I did this
gemfile
source 'https://rails-assets.org' do
gem 'rails-assets-bootstrap-material-design'
end
application.css.scss
I tried both
#import 'bootstrap-material-design';
and
*= require bootstrap-material-design
on the second one I run the command
bower install bootstrap-material-design
and after on my application.css.scss I did
#import '../../../vendor/bower_components/bootstrap-material-design/sass/bootstrap-material-design';
Any tips on how to solve this?
Thanks

Related

Active Admin Trumbowyg #import not found error in Rails app

I'm trying to add the Trumbowyg WYSIWYG editor to a rails app using Active admin using this gem.
The instructions seem clear, but I'm getting the following error for the scss import:
SassC::SyntaxError at /admin/messages/new
Error: File to import not found or unreadable:
activeadmin/trumbowyg/trumbowyg.
on line 16 of app/assets/stylesheets/active_admin.scss
>> #import 'activeadmin/trumbowyg/trumbowyg';
I tried removing the import line. This allowed the app to load, but of course the editor tools did not appear.
Could anyone please suggest a way to fix this?
You have most probably missed importing Active Admin JS files in the app/assets/javascripts/active_admin.js file. As it mentions on the gem's page that you have linked. Just add these lines to the above file-
//= require activeadmin/trumbowyg/trumbowyg
//= require activeadmin/trumbowyg_input

Custom SCSS file is not importing

I'm working on a rails app and using Sass. So far everything has been done in the application.scss file which has worked great.
I'm having two issues which I think are caused by the same problem.
1) I created a users model which generated a users.scss file. When I started to use it, I noticed that it wasn't actually importing into the final web page. So at the top of the application.scss file I added #import "users". Which leads to issue 2.
2) When running the final page, I get a Syntax error:
Invalid CSS after "// VARIABLES": expected selector or at-rule, was "$hero-font: Lor..."
I'm wondering if I might have missed where the import is happening for the Sass files or am using them incorrectly?
Thanks!
I added back the *= require statements from the application.scss file.

Application.css.scss causing issue with rails 4

So i've been learning ruby on rails and i decided to add some style to my new posts page on a myrubyblog app. Everything was working. After a few days i decided to import scss from the posts.scss file into the application.css.scss and well i get this error
RuntimeError in Home#index
Showing c:/Sites/myrubyblog/app/views/layouts/application.html.erb where line #5 raised:
Current ExecJS runtime does't support ES5. Please install node.js.
(in c:/Sites/myrubyblog/app/assets/stylesheets/application.css.scss)
Extracted source (around line #0):
After removing my application.css.scss file, the pages were working. Upon removing the actual scss code and leaving the application.css.scss the page began to give problems again. I decided to leave the application.css.scss file deleted. This for some reason allows for the styles i set in it to show up even though the stylesheet itself has been deleted.
Installing Node.js seemed to have worked. I just had to reboot.... twice...
Thx guys i guess.

How to implement a FlatDream Bootstrap theme in a Rails4 App?

I am working on my first ever Rails 4 app and have to integrate FlatDream theme in it. So far I could not find some easy to use and decent tutorial to stylized a Rails app based on a themeForest theme. Can you guide some pointers?
Here are the steps.
Install gem "bootstrap-sass" if you don't already have it. You can install it by adding the following line to your gem file.
gem "bootstrap-sass"
bundle install
Next create a file named custom.css.scss (app/assets/stylesheets) and add the following two line to it
#import "bootstrap";
#import "bootstrap-responsive";
Next add the following to app/assets/javascript/application.js
//= require bootstrap
Now you need to convert your your css files of your theme to scss. There are converters which can help you with this. Google is your best friend here. Put the scss files image files etc at right places. If the theme uses some custom javascript you need to add it to your project in standard manner.
You are good to go.

Trouble getting started with compass-rails for sprites

I'm trying to start using compass to manage sprites in my Rails project. Following the "Basic Usage" section of the Compass sprites tutorial, I created sprites.css.scss in my stylesheets directory, with the following lines:
#import "compass/utilities/sprites";
#import "sprite_icons/*.png";
#include all-sprite_icons-sprites;
I also created a directory "sprite_icons" under app/assets/images, and dumped a couple of png files there. When I try to load a page in my rails app, I get this message:
File to import not found or unreadable: compass/utilities/sprites
I decided that maybe the compass-rails gem I installed makes that import unnecessary, so I tried removing it, but then I get this error:
File to import not found or unreadable: sprite_icons/*.png. Load paths: /[...]/app/assets/images
I checked permissions on the new directory and they are readable. It looks like it has the right load path to find my sprite_icons directory.
Any suggestions?
It turns out I hadn't done anything to tell Rails about the existence of sass-rails or compass-rails. So, I needed to add the following to (a file required by) config/application.rb:
require 'sass-rails'
require 'compass-rails'
and now the sprites are generated.

Resources