Displaying 1 result from an estimated 1 matches for "add_newsletter".
2006 May 02
0
Validation in File Upload
...specified in the
form.
The app seems to catch the error and won''t write a row to the DB but it
will create a file sized 0KB in the upload folder and it won''t show the
error messages for that model. (using error_messages_for...)
CODE IS BELOW...Thanks
---CONTROLER----
def add_newsletter
@newsletter = Newsletter.new(params[:newsletter])
if @newsletter.save
flash[:notice] = "Added a newsletter: #{@newsletter.name}"
redirect_to(:action=>''newsletter'')
end
end
----MODEL----
class Newsletter < ActiveRecord::Base
validates_presenc...