Need help on in_place_editor

Hey all,
I do a:
<% for c in @categories %>
<% @category = c %>
<%= in_place_editor_field :category, :name %>
<% end %>

but I keep getting the error:
Unknown action
No action responded to set_category_name

so I wrote a little function:
def set_category_name
@category = Category.find(params[:id])
@category.update_attributes(params[:category])
end

but then I get
Template is missing
Missing template
script/…/config/…/app/views/categories/set_category_name.rhtml

I’m probably missing something on hao to use the in place editor thing.
How
can I tell it to just update my category’s name?

I did put in_place_edit_for :name in my controller

thanx in advance

Pat

Get rid of the set_category_name method you wrote, and change your
in_place_edit_for call to this:

in_place_edit_for :category, :name

It needs both the object and the attribute, not just the attribute.

http://api.rubyonrails.org/classes/ActionController/Macros/InPlaceEditing/ClassMethods.html#M000044

c.

Patrick A. wrote:

Hey all,
I do a:
<% for c in @categories %>
<% @category = c %>
<%= in_place_editor_field :category, :name %>
<% end %>

but I keep getting the error:
Unknown action
No action responded to set_category_name

so I wrote a little function:
def set_category_name
@category = Category.find(params[:id])
@category.update_attributes(params[:category])
end

but then I get
Template is missing
Missing template
script/…/config/…/app/views/categories/set_category_name.rhtml

I’m probably missing something on hao to use the in place editor thing.
How
can I tell it to just update my category’s name?

I did put in_place_edit_for :name in my controller

thanx in advance

Pat

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs