background preloader

RoR

Facebook Twitter

Dynamic Site as fast as a Static Generated One with Raptor. If you ask what's the best way to do a fast content site, many people will point you to Jekyll or a similar tool.

Dynamic Site as fast as a Static Generated One with Raptor

The concept is simple: nothing will be faster than a statically generated website. But writing a complete website statically is not viable because you will be repeating HTML code for headers, footers, sidebars, and more across all pages. But current tools such as Markdown, SASS, Sprockets (or Gulp/Grunt tasks if you're using a Javascript clone of Jekyll) will make it a whole lot easier to properly structure, organize and separate concerns on what are reusable snippets and what is just content. Then it will "compile" the content and the snippets into complete HTML pages ready to just transfer to any web server. Because it's already static files, the web server doesn't need to reverse proxy to an application server or have any other kind of dynamic processing, just serve the files as it would serve any other asset. Problem is: what if I want more from my content web site? Chef Solo: Quick and easy cooking for one ← Vinicius Horewicz.

Chef is a configuration management tool.

Chef Solo: Quick and easy cooking for one ← Vinicius Horewicz

It allows us to manage and automate servers configurations. It uses a Ruby DSL for writing blueprints—called recipes—that defines actions to be taken on the remote servers, e.g. install apache. The Chef ecosystem is immense. Servers, nodes, workstations, agents, cookbooks; myriad of concepts. In this article I will just scratch the surface and present examples to get you running as quick as possible. About Chef In a full Chef organization there must exist a Chef server that stores configuration details of each server—or node—in the infrastructure. When running a small-sized infrastructure, chances are you do not need or want to setup a full Chef organization. There is a knife plugin called knife-solo, that makes working with chef-solo easier and as powerful as with a Chef server.

Set up your kitchen To keep everything organized, create a new project (git repo) and add knife-solo to the Gemfile. Create a basic knife configuration. Managing cookbooks. Chef basics for Rails developers. Chef is a cloud infrastructure framework.

Chef basics for Rails developers

It is a tool that allows us to manage configurations, similar to Puppet and a few other tools, but Chef is my favorite because is written in Ruby. Chef can help you manage your infrastructure dependencies, create folder structure (with ‘knife’) and bootstrap our entire system or update configurations with just a few commands. We’ll walk through the process of setting up a Ruby on Rails server deployment with Chef with this tutorial. We are going to build this tutorial on a brand new Ubuntu/trusty64 server. I have created the following repositories to go along with this tutorial. Our target is: over a Ubuntu/trusty64 brand new server, we want to configure it and install our Rails Application.

For you to have example projects to go with all the instructions written here. How to Wire Up Ruby on Rails and AngularJS as a Single-Page Application - Angular on Rails. This post is now somewhat outdated.

How to Wire Up Ruby on Rails and AngularJS as a Single-Page Application - Angular on Rails

If you’re interested in Angular/Rails/Grunt/JavaScript/HTML, read on. If you’d prefer Angular/Rails/Gulp/CoffeeScript/Jade, check out this newer post. Why this tutorial exists I wrote this tutorial because I had a pretty tough time getting Rails and Angular to talk to each other as an SPA. The best resource I could find out there was Ari Lerner’s Riding Rails with AngularJS. The sample app There’s a certain sample app I plan to use throughout AngularOnRails.com called Lunch Hub. Setting up our Rails project Instead of regular Rails we’re going to use Rails::API. Creating a new Rails::API project works the same as creating a regular Rails project. $ rails-api new fake_lunch_hub -T -d postgresql Get into our project directory.

AngularJS with Ruby on Rails: Zero to deployment in less than 10,000 words. Creating a Skeleton App Even the most basic Rails app requires additional configuration beyond simply running rails new.

AngularJS with Ruby on Rails: Zero to deployment in less than 10,000 words

For example, you may have certain gems you know you'll need from the start. An Angular application will need even more than that, and while the setup we're about to see can (and should) be automated with a rails app template, it's important to see these steps and understand why we're doing them. Our goal here is start from scratch and have an application that renders a view containing a piece of data provided by Angular. That will be sufficient for us to validate that we're moving in the right direction. The basic steps are: Create an empty Rails appAdd some basic gems we know we'll needSet up Bower to manage our front-end dependenciesWrite just enough code to serve content via AngularDeploy to a production server to validate the asset pipeline is working An empty Rails app Our app will be called “Receta”, which is Spanish for “recipe”.

Basic gems > bundle install.