bernat / best_in_place

A RESTful unobtrusive jQuery Inplace-Editor and a helper as a Rails Gem
http://blog.bernatfarrero.com/in-place-editing-with-javascript-jquery-and-rails-3/
1.2k stars 573 forks source link

Not working at all. Is my load order wrong? #599

Closed limsammy closed 6 years ago

limsammy commented 6 years ago

I am trying to implement inline editing using the best_in_place gem. I am using devise and have my user profile show route as the following: get '/profile/:username' => 'profile#show', as: 'user'

Here is my application.js tree:

   //= require rails-ujs
    //= require turbolinks
    //= require_tree .
    //= require jquery3
    //= require best_in_place
    //= require popper
    //= require bootstrap-sprockets

In my assets/javascripts/users.coffee I have the following

    jQuery ->
      $('.best_in_place').best_in_place()

This is the tag I am using on the view: <%= best_in_place @profile_data, :first %>

The page renders successfully but I am unable to click the field to edit it. It stays static even with the best_in_place tag.