Question: ```
value="{{Temp.r1c2t != SS ? '100' : '250'}}"  

```

This code will worked fine.
When am getting value from database it ll show error. 

My code here

```
value="{{Temp.r1c2t != SS ? {{Temp.SSFareAmount}} : {{Temp.SFareAmount}}}}"

```

Answer: 
`rescue ActiveRecord::StatementInvalid => e
 if e.cause.is_a?(PG:: NotNullViolation)
 # do something
 end
end`
You might want to re-raise the exception, when the message doesn't match. Otherwise there is not information about the unhandled exception, what might cause problems.