Displaying 1 result from an estimated 1 matches for "photofile".
Did you mean:
photo_file
2006 Feb 23
7
How to set a relationship with a value from a selection list
...) %>
This work in so much as I can see the albums being listed in the
selection list.
Then in my photo_controller I''m trying to set the relationship when the
photo is saved in a method called ''create''
def create
@photo = Photo.new(params[:photo])
@photo_file = PhotoFile.new(params[:photo_file])
@photo.photo_file = @photo_file
@photo.album = @post.album_id
@photo.blog_user_id = 1
if @photo.save!
flash[:notice] = ''Photo was successfully created.''
redirect_to :action => ''list''
else
render :action => '...