Monday, November 21, 2011

Re: [Rails] Association - strange formatting

On 21 November 2011 21:19, Remco Swoany <lists@ruby-forum.com> wrote:
> Hi,
>
> i have a simple association:
>
> Appartment:
> has_many :leads
>
> Lead:
> Belongs_to: appartment
> attr_accessible :appartment_id
>
> On the appartment show method a partial is include with a lead-form.
>
> semantic_form_for @lead do |f|
> f.input :firstname
> f.input :lastname
>  f.input :appartment,  :as => :check_boxes
>
>
> When the html is rendered the appartment-name (check-boxes) has a
> strange name like this <Appartment:0x007f88cd175400>

That is because you have asked it to show the complete appartment
object in the input box. I am not sure what you are trying to do.
By the way, according to my mail client spellchecker there is only one
p in apartment :)

Colin

--
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@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate