Monday, May 24, 2010

[Rails] Re: Problems with parsing params for Active Record

On May 24, 6:01 pm, tonymocha <mochat...@gmail.com> wrote:
> Hi,
>
> I have come into an odd problem that I couldn't figure out why.
> Basically, what I did is to save a record from the form, but there's
> some field that parsed to the active record returns as nil.
>
> Example:
>
> article = Article.new({"title"=>"halo world","content"=>"lorem ipsum",
> "tags"=>"test,article,fun","project_id"=>"1"})
> #<Article id:nil, title: "halo world",content:"lorem ipsum", tags:nil,
> project_id:nil>
>
> I don't understand why tags and project_id is nil, while I supplied my
> data.
>

Are you using attr_protected anywhere (or are any plugins calling it
on your models) ?

Fred

--
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