David Kimura PRO
Joined 7/18/2015
Drifting Ruby Owner
Ruby Rogues Panelist
David Kimura PRO said over 2 years ago on Slim Select with Stimulus :
  rafal.siepak You may want to try and put the css imports in the CSS file. For example, using bootstrap with css-bundling, if I put the @use in the top of the file, it works.

@use "slim-select/dist/slimselect.css";
@import 'bootstrap/scss/bootstrap';
@import 'bootstrap-icons/font/bootstrap-icons';
@import 'drifting_ruby';

David Kimura PRO said over 2 years ago on Slim Select with Stimulus :
That was going to be similar to my suggestion. What doesn't work with it? Does the search not work or does the html visit not work?

David Kimura PRO said over 2 years ago on Slim Select with Stimulus :
  rafal.siepak   It's hard to troubleshoot without more information. But if I had to guess, the logs would probably look something like this.

Processing by CategoriesController#index as */*
  Parameters: {"query"=>"something"}
No template found for CategoriesController#index, rendering head :no_content

If that is the case, then the code for the format.json will not get picked up. You should update your URL in the view where you're passing in the URL into the stimulus controller with the json format. Something like this should work. 

'select-url-value': categories_url(format: :json)

By doing that, it should then respond with the proper format.

Processing by CategoriesController#index as JSON

David Kimura PRO said over 2 years ago on Two-Way SMS Conversation :
On your ingress of receiving messages, you'd need to have something that parses their text and call on a different function. Having some sort of AI here could help improve the results, but that's definitely a beyond the scope of this content. 

In this particular case, you could change

case body.upcase.strip

to something like

case
  when body.upcase.strip.include?('MENU')

so, each switch in the case statement would need to have the conditional check.

David Kimura PRO said about 2 years ago on Booking System :
With libraries like fullcalendar, I think importmaps often gets in the way more than it actually helps. The problem with fullcalendar, even once you get past this error, is that it internally references main.css which will then lead to the error

Failed to load module script: Expected a JavaScript module script but the server responded with a MIME type of "text/css". 
Strict MIME type checking is enforced for module scripts per HTML spec.

If your project requires something like FullCalendar or any JS library that includes and references CSS files, it may be better to use esbuild via jsbundling-rails

Regardless, if you want to experiment with this, you can pin fullcalendar with something like

bin/importmap pin @fullcalendar/core