Integrating AdminLTE into Ruby on Rails

I'm new to Ruby on Rails and wanted to install a free template called AdminLTE. This allows you to create an application (front-end) easily.

I wanted to integrate it into Rails, but I didn't know how and I couldn't find a solution anywhere.

If anyone can help me that would be awesome.

this is the template website: https://almsaeedstudio.com/AdminLTE

+3


source to share


2 answers


This was only implemented last night. This is how I did it.

Insert this into your Gemfile :

gem 'bootstrap-sass'
gem 'jquery-rails'
gem 'font-awesome-sass'

source 'https://rails-assets.org/' do 
  gem 'rails-assets-adminlte'
end

      

Paste the following into app/assets/javascripts/application.js

//= require adminlte

      

Paste the following into app/assets/stylesheets/application.css

*= require adminlte
*= require skin-blue

      

Create a new file app/assets/stylesheets/custom.css.scss

and paste the following:



@import "bootstrap-sprockets";
@import "bootstrap";
@import "font-awesome-sprockets";
@import "font-awesome";

      

From the AdminLTE source code which is downloaded separately, which you can get from the link provided in your question, go to

dist/css/skin

      

and copy the file skin-blue.css

and paste it in vendor/assets/stylesheets/

to your rails project

Then open starter.html

in the AdminLTE source code and paste the content in <body> ......... </body>

and paste it in <body> ................ </body>

in app/views/layouts/application.html.erb

. Change the body tag to<body class="skin-blue sidebar-mini">

Install the included stones by running bundle install

and then restart the rails server by running rails s

and you will see a nice template which is AdminLTE

NOTE 1: There may be other, more efficient ways to do this. I don't know though, and if anyone does, I'd be more than happy to know how it's done. Until then, this works great for me, and I hope it saves you valuable time.

NOTE 2 You can, of course, change the skin to your liking by modifying the stylesheet you included in vendor/assets/stylesheets

and making the necessary changes to your file app/assets/stylesheets/application.css

. Don't forget to change the class <body > .......</body>

in the fileapp/views/layouts/application.html.erb

+8


source


No need to copy 'skin-blue.css' to

vendor/assets/stylesheets/

      



Paste the following into app / assets / stylesheets / application.css

//= require adminlte/skins/skin-blue

      

+1


source







All Articles