[LRUG] syntax for fckeditor with collection

Ed Davey Ed at veryreal.co.uk
Mon Apr 30 09:17:15 PDT 2007


Hi there,

I'm having trouble with a form used to edit a collection of objects in one
go using fckeditor rather than a textarea.

My form starts out:

	<% form_tag(:action => :update_products ) do %>
	<% for @product in @products -%>

Then if I follow the example given by Scott Rutherford:

	<%= fckeditor_textarea("product", "description", ... %>

I get the following:

--- !map:HashWithIndifferentAccess 
"3890": !map:HashWithIndifferentAccess 
  name: Fresh Caviar D'Aquitaine    (From Siberian Sturgeon Farmed In
France)
  brand_id: "9"
  size: 500g
  price: "37500"
  kings_code: "22115"
  live: "1"
  category_id: "1"
  min_quantity: "1"
  format_id: "10"
description: |-
  testing<br />
  fckeditor
"3891": !map:HashWithIndifferentAccess 
  name: Fresh Caviar D'Aquitaine    (From Siberian Sturgeon Farmed In
France)
  brand_id: "9"
  size: 100g
  price: "7500"
  live: "1"
  kings_code: "22117"
  category_id: "1"
  min_quantity: "1"
  format_id: "10"

If I use the syntax which I use successfully in the rest of the form;

	<%= fckeditor_textarea("product[]", 'description', ... %>

I get this error:

	(eval):1:in `[]': wrong number of arguments (0 for 1)

I'd be really grateful if someone can set me straight here.

Thanks

ED





More information about the Chat mailing list