On 7 December 2010 22:57, Kai Schlamp
<kai.schlamp-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org>
wrote:> I use form_for to access a serialized instance:
> <%= fields_for :settings, @my_model.settings do |settings_form| %>
> where "settings" is the serialized instance. This works fine, but
I
> get the below depreciation. The problem is that when using as
> suggested
> <%= fields_for @my_model.settings, :as => settings do |settings_form|
> %>
> I get some missing model_name error. Of course it has no model name,
> as it is not an ActiveRecord model. But the depreciated form_for way
> doesn''t have that problem.
> Is there a better way now to use a serialized field together with
> form_for?
>
> DEPRECATION WARNING: Using form_for(:name, @resource) is deprecated.
This is talking about form_for, your code above is fields_for ???
Colin
> Please use form_for(@resource, :as => :name) instead. (called from
> _app_views_grids_edit_settings_html_erb___416806962__616774948_0 at /
> home/zeus/projects/my_project/app/views/my_model/
> edit_settings.html.erb:17)
>
--
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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en.