3

I'm looking to use "in_place_editor_field" on an "Index" page of items. Basically I want to mimic spreadsheet functionality for pre-existing line items in order to edit their attributes. However, none of the "in_place_editor" examples I've seen provide any useful real-world application of this nature.

Also, a lot of the existing code examples don't work. I'm aware that the code was removed from Core, but even after installing it as a plugin, it doesn't seem to do anything.

Any ideas?

Best.

humble_coder
  • 2,777
  • 7
  • 34
  • 46
  • any errors? if yes please post – Rishav Rastogi Aug 11 '09 at 07:58
  • My experience is *very* similar to this: (http://railsforum.com/viewtopic.php?id=514). I need to allow for editing with a list of items, not just a single item. Not simultaneous editing, but all viewable at once (e.g. a spreadsheet). – humble_coder Aug 11 '09 at 12:57

2 Answers2

1

I wanted to do the same thing. I found an example at http://docs.activestate.com/komodo/5.0/tutorial/railstut.html Scroll all the way to the bottom and look at index.html.erb.

The trick is that in_place_editor_field needs to work on an instance variable, so inside your loop, you need to set an instance variable and pass that to the tag.

0

I think that this example is better:

<table>
    <tr>   
        <th>First name</th>   
        <th>Last name</th> 
    </tr>  
    <% @person.each do |person| %>
        <tr>  
            <td><%= best_in_place person, :first_name %></td>  
            <td><%= best_in_place person, :last_name %></td>
        </tr>
    <% end %>
</table>

I got this from this page