Fomantic UI: $(…).calendar is not a function

后端 未结 1 982
盖世英雄少女心
盖世英雄少女心 2021-01-28 20:11

I\'m running Rails version 5.2.4 Here is the relevant part of my view in Ruby on Rails

      
相关标签:
1条回答
  • 2021-01-28 20:50

    There are two potential issues with your application.js.

    1. The following lines use // = (notice the space) instead of //=. The Rails guide The Asset Pipeline - 2.4 Manifest Files and Directives specifically states to use //=.

      // = require jquery
      // = require jquery_ujs
      
    2. If Fomantic-UI depends on jQuery to be present you should require it after loading jQuery. Otherwise it tries to register itself as jQuery extension or use jQuery methods without jQuery being loaded.

      This means moving:

      // Loads all Semantic javascripts
      //= require semantic-ui
      

      Below:

      // Load jquery
      //= require jquery
      //= require jquery_ujs
      
    0 讨论(0)
提交回复
热议问题