On 5 Mar 2009, at 14:31, EduardoChinchilla wrote:
>
> Hi folks:
>
> In my create action I´m getting this messagge:
>
> ArgumentError (wrong number of arguments (1 for 0)):
>
> What does this means? Do i´m passing more or less parameters than
> needed?
> Any guidance would be very appreciated
>
> I´m using a form with 3 models, including a model to attach images
> with Paperclip
>
> The create action is pretty standard:
>
> def create
> @property = Property.new (:property)
> end
>
I suspect the line raising that is somewhere inside active record.
Assuming Property is an ActiveRecord method it's expecting a hash to
be passed ( eg params[:property] ) but you're just passing the symbol
property.
Fred
> These are the parameter:
>
> Processing PropertiesController#create (for 127.0.0.1 at 2009-03-05
> 00:06:10) [POST]
> Parameters: {"commit"=>"Incluir Propiedad", "property"=>
> {"garage"=>"1", "purpose"=>"Venta", "front"=>"25",
> "rent_price"=>"1300", "baths"=>"1", "contact"=>{"company"=>"La cantera
> del señor Rajuela", "cell"=>"0123456789", "phone"=>"0123456789",
> "contact_type"=>"Propietario", "fax"=>"2255-14510",
> "first_name"=>"Pedro", "last_name"=>"Picapiedra",
> "email"=>"[email protected]"}, "image_attributes"=>
> [{"photo"=>""}, {"photo"=>""}, {"photo"=>""}, {"photo"=>""},
> {"photo"=>""}, {"photo"=>""}, {"photo"=>""}], "this_type"=>"House",
> "description"=>"casa grande", "rooms"=>"1", "localization"=>"en las
> afueras", "exclusive"=>"0", "address"=>"100 norte del sur",
> "lot_area"=>"1800", "const_area"=>"500", "province"=>"San Jose",
> "sell_price"=>"500000",
> "min_price
> "=
> >
> "150000
> "},"authenticity_token"=>"225a4b100cfce5efa6781ab2eabddc8b2d9690c7"}
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---