Forum: Rails deployment controller mail method

Posted by Mark Preston (markp)
on 2009-08-18 00:46
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
Posted by Mark Preston (markp)
on 2009-08-18 01:35
ok, figured it out.
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.