Topic: not working with rails application

Moussa pro asked 7 years ago


I have a problem with my select tag that does not work.
I work with mdbootstrap 4.4.1
and here is the piece of code that I test but it does not work

<div class="mdb-select">
<label for="sel1">Select list:</label>
<select class="form-control" id="sel1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
</div>


Bartłomiej Malanowski staff commented 7 years ago

Could you please provide us more details? What's the problem?


Currently, we don't have support for Rails

Moussa pro commented 7 years ago

It's the same with simple html. If I test with the package of mdb also it gives me a blank page. So if I can get help with the html only it will be great

Bartłomiej Malanowski staff commented 7 years ago

Please share your HTML code with us

Moussa pro answered 7 years ago


I use mdbootstrap in rails application (solidus ecommerce)
In my file application.scss i have

@import 'spree/frontend/mdb';
@import 'spree/frontend/mdb.scss';
@import 'spree/frontend/bootstrap.css';
@import "spree/frontend/bootstrap.min.css";
@import "spree/frontend/mdb/pro/_autocomplete.scss";
@import 'font-awesome';
@import "spree/frontend/mdb.min.css";

And the file all.scss
@import "bootstrap";
@import "mdb";
@import "font-awesome";
@import "materialize";
@import "style";

And for file application.js
//= require materialize
//= require jquery_ujs
//= require turbolinks
//= require_tree .
//= require popper

And the file all.coffee

#= require jquery
#= require tether
#= require spree/frontend/bootstrap
#= require spree/frontend/mdb
#= require materialize
#= require jquery_ujs
#= require spree
#= require spree/frontend

in my html.erb file

<div class="mdb-select">
<label for="sel1">Select list:</label>
<select class="form-control" id="sel1">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
</select>
</div>

<script>
$(document).ready(function(){
$('.mdb-select').material_select();
});
</script>



Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue

  • ForumUser: Pro
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: -
  • Device: -
  • Browser: -
  • OS: -
  • Provided sample code: No
  • Provided link: No
Tags