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 Aljord 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
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk
-~----------~----~----~----~------~----~------~--~---