search for: new_tutori

Displaying 1 result from an estimated 1 matches for "new_tutori".

Did you mean: new_tutorial
2006 Mar 18
5
How would I get the previous id from the database?
...would be input and then rename an uploaded image to that row number. So say the previous row was 19 and the image in that row was named 19.jpg, I''m wanting to name the next uploaded image as 20.jpg since the row that would be added then would be 20. Right now I''ve just got: @new_tutorial = Tutorial.new(params[:tutorial]) File.open("#{RAILS_ROOT}/public/pictures/1.jpg", "wb") do |f| f.write(@params[''image_url''].read) end Obviously the "1" in "1.jpg" needs to be dynamic. -- Posted via http://www.ruby-forum.c...