Want to share this amazing link. Was having an issue yesterday with a silent failure of a rails app- no error message, no server logs. The browser just kept waiting for a response from the app. I suspect the issue had something to do with a gem, and a bundle update fixed the issue. But while I was looking for resources, I found this: Debugging Rails with Operating System Tools.
I recently built a CSV parser and Quickbooks importer using the qbo_api gem. The documentation for the gem was not easy for me to understand, but I was able to hack the functionality I needed into the sample Sinatra app that’s provided with the gem.
I now want to create another Quickbooks import tool and use it with a rails app that I’ve already built. The trouble is figuring out how to set up a rails app to use the qbo_api gem. There are no explicit instructions on how to do this in the gem’s documentation.
After a few hours of hacking around last night with a buddy, I have a slightly better understanding of what’s going on under the hood with the gem.
Looking at the example app provided with the gem, you can see from the require statements that there are a few other gems required: omniauth and omniauth-quickbooks. Omniauth-quickbooks is a strategy for omniauth to connect to quickbooks, specifically.
Lines 19-21 of the example app tell Sinatra to use the omniauth-quickbooks strategy, with tokens that are stored in the .env file. Lines 31 – 36 set up the index page of the app, where you connect to quickbooks:
In the hash, consumer_key and consumer_secret are constants, pulled from the .env file when the app loads. But the token, token_secret, and realm_id are pulled from the session. When the index page is first loaded, these haven’t been saved to the session yet.
The assignment to the session happens in the last route, starting at line 64:
I haven’t yet figured out what env[“omniauth.auth”][:credentials] are, but I assume it is created by the omniauth gem and holds the tokens returned from Quickbooks when you connect.
I built a Rails App that could be used by environmental groups to monitor water quality. It uses the Google Maps API. Users can create locations by entering GPS coordinates, or by clicking on a map. Clicking a location on the map automatically enters the GPS coordinates into the form. It also has different custom map icons depending on the type of location.
This project took about 8 hours all told. It uses Devise for authentication and Bootstrap for the layout. Feel free to check out the public version on heroku. You will need to create an account in order to add locations.
So last month my trusty old Windows 7 laptop (which I grabbed at a great price right when Windows 8 was getting pushed out) died, or at least the monitor did. My life situation was a little hectic and I needed a laptop fast. So I rushed out and bought a new one.
I’ve still been using the old laptop for rails development, dual booting Ubuntu, just plugged into a monitor. Meanwhile I’ve been trying to set up Virtual Box to run linux on the new laptop, with a good deal of trouble.
I was finally able to get Linux Mint running, after several hours spread out over a month. It turns out that I had to follow these instructions to allow any virtual machine to run. Once that was done, installation was relatively straightforward.
I’ve been struggling with VirtualBox ever since I started learning rails. I’m excited to start playing around with it now!
There is so much common sense in here, from a web business perspective, to user experience, to the web as a political space. Do yourself and the world a favor and read.
I added a view with some basic add, edit and delete actions to the rails app I built for work. The main problem is that there are none of the rails view helpers, so I am having a problem with figuring out how to implement a select box in coffeescript, and how to deal with associations, so this new view is not ready for production but I hope to get it going soon.
I’ve been kind of scattershot in my learning lately. I’ve been unsure as to what direction I should go. I’ve dabbled in Angular and Meteor. I tried a C++ course through Coursera and downloaded Visual Studio but I was turned off by the massive download and new environment.
I went to Meteor Spacecamp this weekend. I’ve been working on new features for the app I built for work. I’ve been thinking through a new app for work and made a couple of tries at that. I’ve also been trying to deploy an existing app as a volunteer project. That one’s hard.
As far as learning goes, I’ve decided to settle on learning C for now. I know it’s a language that will be replaced by Rust or some other language and there’s no real reason to write code in it, but it seems like a good opportunity to get a deeper understanding of how code works in general. Ruby is written in C. So is PHP.
So I’ve started Zed Shaw’s Learn C the Hard Way, and I’m really liking it! I’m up to chapter 15 on pointers. I plan on completing this before I move on to something else.
I’ve been hearing about the MEAN stack for a long time now. I heard what it stands for: Mongodb, Express.js, Angular, and Node. I also heard that it was roughly analogous to the LAMP stack (Linux, Apache, MySQL, and PHP).
Mongodb is the database
Express.js is a framework like Sinatra
Angular is the templating framework (like erb)
Node is the server
NPM is like Bundler.
I had the chance to listen to this talk today:
I’m happy to report that the only vulnerabilities reported were due to the version of rails I used, and not my code. But then, after watching the video, I wonder what that’s worth?