Daniel Ochoa

Daniel Ochoa

When in trouble or in doubt, run in circles scream and shout...


Last posted 5 months ago


About

Contact


Categories


Meta

Test jquery.ui sortable with ease in Rspec

Feb 28, 2014 | Posted in Ruby and Rails

Henry_treffry_dunn_rossetti_and_dunton_at_16_cheyne_walk

Are you trying to reach over 95% code coverage in your Rails app? (I use the gem simplecov to achieve this, it is awesome), well I do.

There was a portion of my rails app that may have been somewhat tricky to test with integration tests using Rspec, Capybara, and my favorite headless driver for Capybara, Poltergeist.

This...

Read More


Building API's with Rails

Oct 07, 2013 | Posted in Rails

Screen_shot_2013-10-07_at_12.45.58_pm

Whenever building a mobile app, more often than not you need your application to communicate with an external service. Using Rails as this service is very convenient since it provides a very good RESTful API.

With rails 4, you no longer have to override some rails methods such as #to_json(options = {}) to include/exclu...

Read More


AngularJS example with a resolver

Jul 02, 2013 | Posted in Javascript and AngularJS

Angularjs

Lately I've been working with the great AngularJS. I say great because once you start looking into how it works you realize how antiquated and unintuitive using nothing but jQuery was. Not that there's anything wrong with creating SPA's (Single-Page Applications) with jQuery and some dandy javascript design patterns, but when you start doing any...

Read More


Rails 4 on Heroku

Jun 03, 2013 | Posted in Ruby and Rails

Heroku3

Rails 4 ushers a new era of agile web development, and with it, new things to keep in mind when pushing your latest application to heroku.

Rails 4 uses ruby 2.0

Ruby 2 is required by rails 4. In order to have it recognized in heroku you need to add it to your gemfile below the source 'http://rubygems.org' line...

Read More


Change user attributes in your User object without having to update the password...

Apr 22, 2013 | Posted in Ruby and Rails

Say you want to change some User attributes (not all of them) with some form. But, when you submit it, you get errors for the password and password confirmation validation. It's easy to understand why this is happening -- the user object will not update because it's not passing the proper validations for it's attributes, even though you are not ...

Read More


Disable all the contributed modules from a site in one drush line

Apr 20, 2013 | Posted in Drupal

If you work in drupal and you aren't using Drush, well, you should. Drush brings to the table many commands you can use to work with Drupal sites. Say you are working in a Drupal site, and you want to disable all contrib modules in one fell swoop. This one is just one of the things you can accompl...

Read More


I just got an idea...

Apr 16, 2013 | Posted in Rants

I just got an idea on how to extend this blog. Since I already have the models for validation and users built in, I'll just do some more adjustments to let anyone create his or her own blog - they will have their own subdomain and all, a beautiful backend interface, and above all - simple to use. I'll arm twist everyone at work to join muahaha.


Hello World!

Apr 15, 2013 | Posted in Untagged

Url

I've decided to invest my time in becoming a Rails developer. And for that end I need to start building apps. Reading huge amounts of material is useless if you don't apply what you are learning, so for my first project I decided to remake my website in rails. It is basically a blog with two pages, it shows my gravatar according to my user email...

Read More