fix for in_place_editing problem I had

| 1 Comment

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

1 Comment

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.

About this Entry

This page contains a single entry by Rory2 published on August 27, 2006 11:17 AM.

Ruby On Rails was the previous entry in this blog.

Migrations Posting is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.

Pages

Powered by Movable Type 4.37

About this Entry

This page contains a single entry by Rory2 published on August 27, 2006 11:17 AM.

Ruby On Rails was the previous entry in this blog.

Migrations Posting is the next entry in this blog.

Find recent content on the main index or look in the archives to find all content.