is there any alternative for Bootstrap-slider-rails gem in Rails 6.0.3.4 - ruby-on-rails-6

As Bootstrap-slider-rails gem is not support for Rails 6.+ version as per document.
railties < 6.0, >= 3.2
So when i want to migrate from rails 5.2.4.4 to rails 6.0.3.4 am not able to get run application becuase this particular gem is not suitable.
Is there any alternative for this gem or any changes needs to done with existing gem.
Thanks in advance.

The repo for the gem doesn't exist but there is an option of using https://github.com/seiyria/bootstrap-slider or in my opinion, the best option would be to use bootstraps inbuild range https://getbootstrap.com/docs/5.0/forms/range/
<link href="https://cdn.jsdelivr.net/npm/bootstrap#5.0.0-beta1/dist/css/bootstrap.min.css" rel="stylesheet"/>
<label for="customRange1" class="form-label">Example range</label>
<input type="range" class="form-range" id="customRange1">

Related

Twitter Bootstrap doesn't show up in my Rails app (using the Gem)

I use Twitter Bootstrap in my Rails application, but for some reason it has stopped showing up and the app is now a mess without bootstrap. I use the Twitter Bootstrap Gem in my Gemfile by saying this:
gem 'twitter-bootstrap-rails', :github => 'seyhunak/twitter-bootstrap-rails', :\
ref => "85ad702d75abb2338c3be87ab1a970a3ba9a1ab0"
Once I bundle install and locate where Twitter Bootstrap installed to (using bundle show twitter-bootstrap-rails), Rails tells me that it's installed at /my_app_path/target/ruby/1.8/bundler/gems/twitter-bootstrap-rails-85ad702d75ab.
In my bootstrap_and_overrides.css.less stylesheet (where I use bootstrap), I have the following commands that should be importing bootstrap but fail:
#import "twitter/bootstrap/bootstrap";
#import "twitter/bootstrap/responsive";
This same code is running on a server but won't run on my machine and I can't figure out why - Any help would be appreciated - thanks!

Rails 4 & Compass: can't route to precompiled image in production from css

When I'm launching my Rails 4 app in development mode – everything works fine, but when I'm trying to precompile assets and then run it in production – my images couldn't be founded on a server.
The problem is in the image request url: it has no fingerprint on the end.
For example, my precompiled image lay at the /assets/image-12rfh98hf734hgf973.png and the request is just the /assets/image.png.
So, the question is how do I write my code inside sass file's to route the correct image?
My gemfile is
gem 'rails', '4.0.1'
gem 'sass-rails', '~> 4.0.0'
gem "compass-rails"
gem 'haml-rails'
I'm trying this code, but it doesn't produce fingerprint in compiled css:
#include background(image-url("baloon_big.png"));
and some variations of image-url, like image-path, image_path etc.
In Rails 3 I hadn't faced this problem, so may be the problem is in the gems.
Thanks in advance.
EDIT
Figured out that problem is only in my work machine – I'm deployed my app to heroku and paths resolving fine (with fingerprints). The question is still open – what's wrong with me (and my computer).

What is the proper file path for Bootstrap 2.3.2 Glyphicons?

I've beens searching around, and I see a ton of different proposed file paths, none of which work for me.
What do I change background-image: url("/../img/glyphicons-halflings.png"); to?
In short, if you use Rails assets pipeline all your assets will be compiled to /assets folder. There is also an option to change the folder name. Please refer to the guide for more details.
If you use scss with sass-rails gem there are helper methods asset-url and image-url that can help you manage with assets path for your CSS.
Lastly there are a couple gems you can use to include bootstrap in your Rails app:
https://github.com/seyhunak/twitter-bootstrap-rails is a less version (Bootstrap is built with less). It requires less-rails gem and https://github.com/thomas-mcdonald/bootstrap-sass

Rails 4 RSpec warning: you should require 'minitest/autorun' instead

In trying to run RSpec on Rails 4, I immediately get a warning:
you should require 'minitest/autorun' instead
that comes up in the backtrace assigned to the line
require 'rspec/rails'
in spec_helper.rb If I add this before it
require 'minitest/autorun'
the warning goes away. Is this a fix? Should I also remove the line
require 'rspec/autorun'
that follows? Alternatively, the problem goes away without changing the spec_helper.rb file if I add
gem 'minitest'
to the gemfile
It will do this with a single spec file that only contains
require 'spec_helper'
We're running Rails 4.1.0.beta.
Please have a look at this:
https://github.com/rspec/rspec-rails/pull/772
If you use 'shoulda' or 'shoulda-matchers' in your Gemfile, please add 'require: false' to them.
This is still a bug for Rspec 3.0.0 in Rails 4.1.1. It is important to put gem 'minitest' before gem 'rspec-rails' in the Gemfile, otherwise it won't work. If you're using flexmock, minitest needs to go before that too.

Require specific gem version in SASS & Compass

I know this is probably more a Ruby question but I work on several projects where I've used compass plugins. Later on I upgrade these plugins and start new projects. The issue arises when I need to go back and make amends to an older project.
How can I amend my config.rb file to use a specific version of a gem?
For example I often use the Compass plugin: http://rubygems.org/gems/html5-boilerplate/versions
The line in my config.rb file looks like this:
require 'html5-boilerplate'
But I would need 1.0.0 for one project and 2.1.0 in another.
Suggest using rvm (the Ruby enVironment Manager), bundler and gemsets. rvm for managing ruby versions and for allowing you to use gemsets - bundler to specify the versions of the gems you want to use in the project. After you install the bundler gem and have a Gemfile that uses the syntax you have already discovered
gem "html5-boilerplate", "~> 2.1.0"
bundle install will then bring down the gems you need for your project. Read more at http://gembundler.com
gemsets can also be project specific and different gemsets can have the same gems at different versions. you can specify the gemset associated with a project via a .rvmrc file in the project's root.
There are several nice posts out there on how to set up rvm and gemsets. Here's a good example of one to get you going:
http://adamstacoviak.com/posts/super-easy-ruby-gem-management-with-rvm-gemsets/
And here's one that also covers bundler:
http://lindsaar.net/2010/3/31/bundle_me_some_sanity

Resources