Dark Ambient
2006-Nov-02 00:19 UTC
Re: Ajax In place editor with drop downs (need help please)
Forget what I said before. :)
I''m trying to use the Ajax In-Place Editor with drop downs.
In Scriptaculous 1.5.3 an Ajax In Place Collection Editor was added.
This is about it as far as integration with Rails :
http://fora.pragprog.com/rails-recipes/write-your-own/post/223
Here is something I don''t understand -
"For example, in a *list.rhtml* file, the following defines an editor for a
field called *custom_field* that has a number of options taken from the *
FieldType* model:"
<%= in_place_collection_editor_field ''custom_field'',
''field_type'',
FieldType.find_all.collect{|x| [x.name,x.id]} %>
Okay, I get this but why isn''t the model for the custom_field included
?
Normally in a collection_select it would be :(model :method ....)
So that is kind of weird. And what is really throwing me is the controller
code:
def set_custom_field_field_type
@i = CustomField.find(params[:id]) # if this is the field that the params
will be written to why am i doing a find?
f = FieldType.find(params[:value])
.................
end
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---