title: Syntax Error "syntax error, unexpected tFID, expecting keyword_then or ';' or '\n' " While checking existence of object
body: <p>In my Rails application I need to check if an object exists and if it does, I need to assign the latitude and longitude attributes of that  object to two external variables named latitude and longitude.</p>
  
  <pre><code>my controller code 
        def query
  
        if ( Coordinates.where(city :params[:show]).exists?) equal? 1) then
  
                             a=Coordinates.where(city: params[:show])
  
                                latitude=a.latitude
  
                               longitude=a.longitude
  
                          end
  </code></pre>
  
  <p>But When I run the  program  In the browser I am getting syntax error despite I tried several times changing the syntax The error I am getting is "syntax error, unexpected tFID, expecting keyword_then or ';' or '\n'". Anybody please help me how to solve this problem ,thanks in advance</p>