itmammoth / rails_sortable

Easy drag & drop sorting with persisting the arranged order for rails
MIT License
142 stars 37 forks source link

$(...).railsSortable is not a function Rails 5.2 #31

Closed Innarticles closed 6 years ago

Innarticles commented 6 years ago

Hello @itmammoth,

I have been struggling to get this working. This is my setup:

My gemfile `` surce "https://rubygems.org" git_source(:github) { |repo| "https://github.com/#{repo}.git" }

ruby "2.4.1"

gem "active_type", ">= 0.3.2" gem "autoprefixer-rails", ">= 5.0.0.1" gem "bcrypt", "~> 3.1.7" gem "bootsnap", ">= 1.2.0", require: false gem "coffee-rails", "~> 4.2" gem "dotenv-rails", ">= 2.0.0"

gem 'jquery-rails' gem 'jquery-ui-rails' gem 'rails_sortable' gem "mail", ">= 2.6.3" gem "marco-polo" gem "pg", ">= 0.18" gem "pgcli-rails" gem "puma", "~> 3.11" gem "rails", "~> 5.2.1" gem "sass-rails", "~> 5.0" gem "sidekiq", ">= 4.2.0" gem "turbolinks", "~> 5" ` and my model class Lesson < ApplicationRecord belongs_to :course include RailsSortable::Model set_sortable :sort # Indicate a sort column end

application.js //= require jquery //= require jquery_ujs //= require jquery-ui/widgets/sortable //= require rails_sortable //= require activestorage //= require turbolinks //= require_tree .

base.html.erb

Innarticles commented 6 years ago

I had to copy plugin.js into my app to make it work. It might be coming from my asset pipeline Closing this for now

JKinnez commented 4 years ago

@itmammoth I'm having the same issue, is this working in Rails 5.2

Hessah95 commented 1 year ago

I'm having the same issue too but with Rails 7, any solution to suggest?

itmammoth commented 1 year ago

Let me have a look at the error and your code.