fix for in_place_editing problem I had

Aug 27th, 2006

Comments: 1
Category: Ruby On Rails

fix for in_place_editing problem I had

One of the cool things about rails is the Scriptalicious javascript library which you get as part of rails. I’ve just been trying to add in place editing to some of the fields in my app and I encountered a problem with way it’s implemented in conjunction with the way I was decribing the view.
Anyway a much better description of the exact problem I was having and a solution (which is in the comments to the post) is at the Rabiit Creative Blog

DISCUSSION 1 Comments

  1. Rabbit March 29, 2008 at 8:57 pm

    Since your blog is referencing a post which is no longer there I’ll post what I remember of the problem and the solution…
    Problem is you want to display multiple in-place editor fields. However, saying something like…
    @people.each do |person|
    in_place_editor_for(person)
    end
    Doesn’t work. The JavaScript method expects an instance variable. So pass it one.
    @people.each do |person|
    @person = person
    in_place_editor_for(@person)
    end
    Hope that helps.

Add a comment

Your email address will not be shared or published. Required fields are marked *