Forum: Ruby on Rails Using dropdown to choose ID (noob question!)

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
morykon (Guest)
on 2005-12-07 03:23
(Received via mailing list)
I'm trying to use a dropdown to select the id of a record to load.

My view code:

<%= form_remote_tag :update=>"editAread", :url => {:action =>
"loadArea"} %>
<%=collection_select(:area, :id, @areas, :id, :name ) %> <%=
submit_tag 'Load' %>
<%= end_form_tag %>

Then the controller code:

  def loadArea
      render :partial => "editArea"

But I get this error:

Unknown key(s): id

There is an id field in the content_areas table. What am I missing here?
mrj (Guest)
on 2005-12-07 05:53
(Received via mailing list)
Brian Morykon wrote:

> <%=collection_select(:area, :id, @areas, :id, :name ) %> <%=
>       @editArea=ContentArea.find(params[:area])


We develop, watch us RoR, in numbers too big to ignore.
This topic is locked and can not be replied to.