Controller mail method

I have the following method in my controller:

def send_contact_request
@contact = Contact.new(params[‘contact’])
if @contact.save
begin
Mailer::deliver_contact_message(@contact)
flash[:notice] = "Success!”
redirect_to :action => “contact”
rescue
flash[:notice] = “It broke!”
render :action=>“contact”
end
else
render :action=>“contact”
end
end

end

When I try to run the project, I get the following error:

C:/rubyapps/fcalc/app/controllers/numbers_controller.rb:96: syntax
error, unexpected tIDENTIFIER, expecting kEND
redirect_to :action => “contact”
^
C:/rubyapps/fcalc/app/controllers/numbers_controller.rb:99: syntax
error, unexpected tIDENTIFIER, expecting kEND
render :action=>“contact”
^
C:/rubyapps/fcalc/app/controllers/numbers_controller.rb:102: syntax
error, unexpected tIDENTIFIER, expecting kEND
render :action=>“contact”
^
C:/rubyapps/fcalc/app/controllers/numbers_controller.rb:102:
unterminated string meets end of file
C:/rubyapps/fcalc/app/controllers/numbers_controller.rb:102: syntax
error, unexpected $end, expecting kEND

I sure it’s staring me in the face, but I have been looking at it so
long I can’t see it

ok, figured it out.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs