Skip to content

Commit

Permalink
relacion entre preguntas y lugares, fix #19
Browse files Browse the repository at this point in the history
  • Loading branch information
juanjcsr committed Apr 29, 2014
1 parent 504502e commit b250944
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions app/controllers/pregunta_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,13 @@ class PreguntaController < ApplicationController

def preguntar
pregunta = params[:pregunta]
a = Pregunta.save!(texto: pregunta)

lugares = Place.near(a.texto + "")
a = Pregunta.create(texto: pregunta)
if a.is_in_cat?(a.texto)
lugares = Place.get_hospitals
else
puts "por lugar"
lugares = Place.near(a.texto + " Ciudad de Mexico", 2)
end
respond_to do |format|
format.json do
to_json lugares
Expand Down

0 comments on commit b250944

Please sign in to comment.