Note that there are some explanatory texts on larger screens.

plurals
  1. PORails Best_in_place edit issue
    text
    copied!<p>I am trying to implement the <a href="https://github.com/bernat/best_in_place" rel="nofollow">best_in_place</a> in my rails app and I cannot figure out how to implement it. It just doesnt do anything when I scroll over the text that needs to be edited. I have a nested profile model under Users and I want to edit the Users name. But the name is under the Profile Model. So I have "user.profile.name". I have folowed the installation steps and included and installed the gem and included the jquery files in my application.js as mentioned!</p> <p>Here is my show view:</p> <pre><code>&lt;%= best_in_place @profile, :name, :type =&gt; :input, :path =&gt; user_profile_path(@user) %&gt; </code></pre> <p>Here is my show action in Users controller:</p> <pre><code> def show @user = User.find_by_identifier!(params[:id]) @profile = @user.profile end </code></pre> <p>Here is my Profiles controller:</p> <p>respond_to :html, :json</p> <pre><code> def edit @user = User.find_by_identifier!(params[:user_id]) @profile = @user.profile end def update @user = User.find_by_identifier!(params[:user_id]) @profile = @user.profile @profile.update_attributes(params[:profile]) respond_with @user end </code></pre> <p>This is my application.js file</p> <pre><code>//= require jquery //= require jquery_ujs //= require best_in_place //= require best_in_place.purr //= require_tree . $(document).ready(function() { /* Activating Best In Place */ jQuery(".best_in_place").best_in_place(); }); </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload