Re: Ajax In place editor with drop downs (need help please)

Forget what I said before. :slight_smile:

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

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