Reputation: 8988
Which is the best way to convert that :id variable
@object = Object.find(params[:id])
into a string?
render :json => {"status" => "404", "message" => "Object with id " + ":id" + " not found"}
Also tried:
render :json => {"status" => "404", "message" => "Object with id #{:id} not found"}
But it gives this error:
no implicit conversion of Symbol into String
Upvotes: 0
Views: 116