in_place_editing icon indicating copy to clipboard operation
in_place_editing copied to clipboard

Cannot use in index scaffold view

Open eggie5 opened this issue 15 years ago • 1 comments

This works when I use it in a scaffold edit view but it doesn't work when I use it in the index scaffold view? What is this?

I get an error similar to this:

Called id for nil, which would mistakenly be 4 -- if you really wanted the id of nil, use object_id

My view code for index is standard like this:

<% @dogs.each do |dog| %>

....

The problem is in this code:

def in_place_editor_field(object, method, tag_options = {}, in_place_editor_options = {}) instance_tag = ::ActionView::Helpers::InstanceTag.new(object, method, self)

How can I adapt this to work in my index view?

eggie5 avatar Nov 08 '09 11:11 eggie5

I just saw your comment, so it might be a bit late for you if you haven't figured it out by now...

<% @dogs.each do |dog| %> should actually be <% for @dog in @dogs%>

In Place Editing requires instance variables to work... like you rightly point out in the code. Local variables just don't cut it...

ghost avatar Jan 09 '10 22:01 ghost