I have had and done some really awesome things this past week. I’ve also had massive frustrations. There was the struggle to figure out how to get user authentication to work correctly in my app. then there was implementing a google maps search, which is super easy if you are working with a single html page… not so much when you are working with a whole app. I tried three different methods including writing all the code myself. Ultimately, I went with the gmaps4rails gem which was not easy (very bad documentation), but it turned out to make more sense then rewriting everything myself.
I wrote a simple search engine that allows the user the type into a search box, this searches our therapist database, looks at the location attribute, and sees if any of the words match. Then it passes in the geo-coded locations to google maps and create markers on the map associated with each therapist returned.
It works! However, I need to fix it to search for geocodes (already in the database), and return actually nearby therapists. Right now a search for ‘austin’ will return any location with the word “austin” in it, even if it is a street address in Washington State. That won’t work so well for finding therapists in Austin, TX. So even though I am quite proud of having a working search engine that I coded myself, I think I may have to mostly scrap it.
Maybe I will set up options to refine the results: “Did you mean Austin Tx or Austin, ST?”
The other big problem was that after getting our user authentication set up with Devise, it still would not allow us to save all of a user or therapists attributes to the database when we used the new user/therapist sign-up and account-update pages.
It turns out, there was an extra configuration step that was needed specifically for those forms. Anyhow, got it working. Users can now add to our therapist and user databases, which then works with my awesome search function.
Awesome! So today I am tackling the Heroku deployment. The Beta version of Therapy Lane is coming soon!