background preloader

Rails

Facebook Twitter

Rails_standards/README.md at rails-3-2 · hopsoft/rails_standards. Diary of a Rails rescue project, part 2: Testing. April 16, 2013 As mentioned previously, I’ve been spending spare cycles getting an outdated Rails application up to speed.

Diary of a Rails rescue project, part 2: Testing

Aside from the outdated versions of Rails and pretty much every gem used by the app, there’s a glaring problem: No usable tests. Without tests, I can’t be certain of what the application is supposed to do. What’s more, I can’t be sure that the rather massive changes I’m making to the code’s underpinnings won’t break functionality. While the previous developer did have some tests in place, I quickly lost faith in them: On first run I got a number of deprecation warnings, then 60 percent of the provided tests failed. To address this, I decided to write out my own high level tests of the application’s core functions. I got a handle on what parts of the application were being touched by each given user interaction. Before I could do that, though, I wiped out the existing spec/ directory and started fresh. As it turns out, quite a bit. Diary of a Rails rescue project. March 21, 2013 I recently picked up a rescue project.

Diary of a Rails rescue project

It’s pretty gnarly–the application was, I believe, originally written in Rails 2.3 (possibly older), was updated to Rails 3.0 at some point, and sat unattended for most of last year. When major security issues hit Ruby and Rails the past few months, there were concerns that the application would have to be taken offline if action weren’t taken. So I agreed to the work. Rescue projects are unique challenges. List of 40+ tutorials on how to create an API. Exercism.io. BBC-News/wraith. Leveraging your Intuition. Have you ever felt certain of something, despite not having any evidence to back up your hypothesis?

Leveraging your Intuition

My Experiences with Ruby off Rails. I was recently pointed to Ben Singelman’s post on Why Nobody Should Use Rails For Anything, Ever.

My Experiences with Ruby off Rails

We seem to never get enough of arguing about application frameworks: I’m not going to do that. What irks me is when Ruby get thrown out with the Rails bathwater. As one commenter on Singleman’s post demonstrates: “Interesting perspective. Evaluating Different Ruby and Rails Versions with RVM. If you've ever had to test an application that you are building with different versions of Ruby or Rails then you know how frustrating it can be.

Evaluating Different Ruby and Rails Versions with RVM

RVM aims to erase that frustration by making it incredibly easy to install multiple versions on the same development machine. The first thing that you will need to do is install RVM. 10 Ruby on Rails Best Practices. If you’re new to Ruby on Rails, one of the most daunting aspects is knowing what’s the preferred way of accomplishing a given task.

10 Ruby on Rails Best Practices

While a lot of techniques and libraries have come and gone as the community’s preferred way of doing something, there are some best practices that remain, and can lead to writing the cleanest, most secure and maintainable Rails code possible. Listed here today are ten of the most popular and useful best practices you can use as a Ruby developer. Fat Model, Skinny Controller Arguably one of the most important ways to write clear and concise code in Ruby on Rails, the motto “Fat Model, Skinny Controller” refers to how the M and C parts of MVC ideally work together. Namely, any non-response-related logic should go in the model, ideally in a nice, testable method. Let’s look at a simple example. Ruby on Rails & Mobile Application Development. Drastically Improving Your Code With Messaging as a Programming Model.

HTTP/HTTPS traffic recording. Learn. It often feels like "best practices" have a shelf-life of a few months before being replaced by better ideas.

Learn

Between Rails’ constant changes and a never-ending stream of new gems and philosophies, it’s a real challenge to keep up with the state of the art. Stay on top of it by reading the source of the Learn app itself, watching the thoughtbot team contribute to it, reading our books (which also come with high quality source code), and watching screencasts on vim, development tools, and more. A fallback plugin for HTML5 Web Notifications. Check the code on Github The code is available on GITHUB.Check the repository wnf.

A fallback plugin for HTML5 Web Notifications

In a recent post on this blog, I wrote about the new HTML5 Web Notification api. Once I discovered this new feature, I couldn’t wait to use it in a real project… the only problem was that currently the support for native web notifications really sucks. Should this distract me from my intent? No way! Not just another notification plugin. Start using Web Notification. Recently I started to use in some personal projects the native browser notifications… if you didn’t hear this term before, you are in the same situation I was more or less three weeks ago.

Start using Web Notification

So you have to know that web notifications allow to alert the user outside the context of a web page of an event, without the need to use third party plugin. Sounds great, right? So, if you are interested this post will guide you through the discovery of web notifications. Ask the user for permission The first thing necessary to show user a notification message is to ask him the permission. window.Notification.requestPermission(function(grant) { });

Coding Online – Reviews of the most interesting services. Recently many services like jsfiddle are came out… to be sincere I actually don’t know neither if jsfiddle was the first.

Coding Online – Reviews of the most interesting services

What is for sure is that until now I used jsfiddle to run the demo of this blog. Web Workers cheatsheet. I continue the series of posts about the new goodies of HTML5 (I hope that you have not missed “Start using Web Notification”, and “Geolocation api cheatsheet”) with this article, that collects the main methods to work with javascript Web Workers. What are Web Workers? Browsers are single-threaded programs; this causes that the scripts executed in every application run together in a single UI thread. DOM event, xhr request or the javascript setTimeout function give us just the illusion that there are more things happening at the same time. Traditionally this was a limitation, and it is for this reason that often the most demanding functionalities in terms of computational power were managed server side. Web Workers API defines a way to run javascript scripts in the background, in parallel with the main page, and allows to overcome the traditional limitations of the browsers. Rails in Realtime — LayerVault Blog.

Come #pairwithme on Ember.js! Pair Programming with Ember.js - Episode 2. 11 Things You Didn't Know About Mountain Lion. OS X Mountain Lion includes over 200 new features for your Mac, but some of the major ones aren’t mentioned on the official webpage. Important Considerations When Building Single Page Web Apps. Single page web applications - or SPAs, as they are commonly referred to - are quickly becoming the de facto standard for web app development. The fact that a major part of the app runs inside a single web page makes it very interesting and appealing, and the accelerated growth of browser capabilities pushes us closer to the day, when all apps run entirely in the browser.

Technically, most web pages already are SPAs; it's the complexity of a page that differentiates a web page from a web app. In my opinion, a page becomes an app when you incorporate workflows, CRUD operations, and state management around certain tasks.

Grid/Table - Expand

Rails 4. Model. UI & UI Libs. Templating. Rails Automate Workflow. Rails Tuts. Rails/Angular - Github, etc. Hey Underscore, You're Doing It Wrong! Three Keys to Successful Single Page Web Applications. You've got 100 milliseconds for your web application to engage your users before they start to feel disconnected from the app. That's 1/10th of a second. After a whole second, you're starting to lose users completely. This simple fact is motivation enough for many to employ usage of single page web applications, and in this presentation from HTML5DevConf, Josh Powell will share three keys to doing so successfully.

Moving logic and data to the client and loading only changes are important pieces of the puzzle, but to make your SPA performant for the user as well as the developer means you'll have to address certain issues with SEO, analytics, error tracking, and more. Join Josh as he walks you through elegant solutions to these challenges. Ready to start coding faster with HTML5? We have a bunch more resources for HTML developers, and we also offer some awesome training courses.

Coffescript

General. Git/Heroku. Ruby on Rails & AngularJS: Resources. I’m a huge fan of AngularJS and an even bigger fan of Ruby on Rails. However, one of the gripes I have with AngularJS is the fact it lacks great documentation. Stuff seems scattered, especially when it comes to the magical ‘Resource’ module. To test the feasibility of AngularJS when using Rails I created a simple project to demonstrate an all AngularJS front-end communicating to a Rails back-end via the Resource module. The following write up starts with setting up Rails and moves into setting up Angular later. Source and Live Demo.

Debugging & Console

Testing.