Hi, Basically "build" adds an object to a collection without automatically saving it. Take a look at:
http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html You can add the picture form to the signup form, but you should probably scope it with form_for or something alike. FInally, don't forget to save it! Cheers, SAzima On Feb 3, 7:29 am, "[email protected]" <[email protected]> wrote: > I would love to make the photo upload at signup mandatory but when I > look at the create action of the photo controller I see > def create > @photo = @my_profile.photos.build params[:photo] > ... > > I cant see find this build method anywhere... > > I guess the params come from > > <% less_form_for [...@my_profile, @photo], :html => {:multipart=>true} do > |f| %> > ... > <%= file_column_field "photo", "image", :size => 25 %> > > So what my plan would be is to include this form in the singnup and > hook the build line above into the login action and pray. Would that > be a right way? --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Lovd by Less" 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/lovdbyless?hl=en Who loves ya baby? -~----------~----~----~----~------~----~------~--~---
