I''m having the strangest problem populating a form partial from a View. My partial is a standard form built by scaffold. I need to call it from another view, and need the data to be prepopulated with the proper edit data. I am calling it like so: @profile = Profile.find(id) render_partial ''form'', :profile => @profile I can verify that @profile actually has the data, and the same form is called during a normal ''edit'' action which works fine. Is there something special about rendering a partial with parameters in a view, or am I just nuts today?
It doesn''t work when I try and call the partial from another view. It displays the view, but not with any data. I suppose the better way to state my question is: How do I change the binding of a standard scaffold form partial? On 6/26/05, Sean T Allen <sean-5W9FBhQXBOtBDgjK7y7TUQ@public.gmane.org> wrote:> when does it not work? > > Michael Gorsuch wrote: > > >I''m having the strangest problem populating a form partial from a View. > > > >My partial is a standard form built by scaffold. I need to call it > >from another view, and need the data to be prepopulated with the > >proper edit data. > > > >I am calling it like so: > > > >@profile = Profile.find(id) > >render_partial ''form'', :profile => @profile > > > >I can verify that @profile actually has the data, and the same form is > >called during a normal ''edit'' action which works fine. > > > >Is there something special about rendering a partial with parameters > >in a view, or am I just nuts today? > >_______________________________________________ > >Rails mailing list > >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > >http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > >
when does it not work? Michael Gorsuch wrote:>I''m having the strangest problem populating a form partial from a View. > >My partial is a standard form built by scaffold. I need to call it >from another view, and need the data to be prepopulated with the >proper edit data. > >I am calling it like so: > >@profile = Profile.find(id) >render_partial ''form'', :profile => @profile > >I can verify that @profile actually has the data, and the same form is >called during a normal ''edit'' action which works fine. > >Is there something special about rendering a partial with parameters >in a view, or am I just nuts today? >_______________________________________________ >Rails mailing list >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org >http://lists.rubyonrails.org/mailman/listinfo/rails > > > >_______________________________________________ Rails mailing list Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org http://lists.rubyonrails.org/mailman/listinfo/rails
Never mind. I am crazy. I had another variable overriding this one. Thanks, though. On 6/26/05, Michael Gorsuch <michael.gorsuch-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> It doesn''t work when I try and call the partial from another view. It > displays the view, but not with any data. > > I suppose the better way to state my question is: > > How do I change the binding of a standard scaffold form partial? > > On 6/26/05, Sean T Allen <sean-5W9FBhQXBOtBDgjK7y7TUQ@public.gmane.org> wrote: > > when does it not work? > > > > Michael Gorsuch wrote: > > > > >I''m having the strangest problem populating a form partial from a View. > > > > > >My partial is a standard form built by scaffold. I need to call it > > >from another view, and need the data to be prepopulated with the > > >proper edit data. > > > > > >I am calling it like so: > > > > > >@profile = Profile.find(id) > > >render_partial ''form'', :profile => @profile > > > > > >I can verify that @profile actually has the data, and the same form is > > >called during a normal ''edit'' action which works fine. > > > > > >Is there something special about rendering a partial with parameters > > >in a view, or am I just nuts today? > > >_______________________________________________ > > >Rails mailing list > > >Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org > > >http://lists.rubyonrails.org/mailman/listinfo/rails > > > > > > > > > > > > > > > > > > > > >