background preloader

Rails

Facebook Twitter

SMACSS and Rails – A Styleguide for the Asset Pipeline. If you’re already familiar with SMACSS, skip ahead to the Rails styleguide.

SMACSS and Rails – A Styleguide for the Asset Pipeline

SMACSS principles SMACSS (Scalable and Modular Architecture for CSS) is a set of CSS guidelines created and promoted by Jonathan Snook, who also offers an e-book of the same name. A generous portion of the book’s contents is available for free at smacss.com. If you aren’t already familiar with SMACSS, I highly recommend the book; it’s a quick read. Let’s recap some core principles of SMACSS before we dive into the Rails implementation. Categorization Base styles are the default styles for HTML elements (h1, p, pre, etc.).Layout styles are grid and other reusable layout classes. Guidelines Avoid IDs in CSSMinimize the depth of CSS selectorsUse classes to define visual presentation patterns1. Getting Started With Ruby On Rails. About The Author Jan Varwig is a programming language enthusiast, currently writing his CS diploma thesis about server-side JavaScript, and a software developer with 10 years of … More about Jan ↬ If you’re a Web developer who’s been curious about Ruby on Rails but has never gotten around to trying it out because you couldn’t find a suitable overview of its advantages, then this article is for you.

Getting Started With Ruby On Rails

We want to bring Ruby on Rails closer to those who want to take a peek first, without going through an entire tutorial. So, this article is structured a little different from most other introductions out there; hopefully it is more useful because of this. I assume you’re already familiar with some other form of Web development, whether PHP, Python, Perl or Java, and relational databases like MySQL. Four Ways Ruby on Rails Can Help You. Ruby on Rails, an open source web development framework, has revolutionized the way we create web applications.

Four Ways Ruby on Rails Can Help You

By giving developers the necessarily tools and components needed to build powerful apps in an intuitive development environment, RoR makes development more efficient and less troublesome. In this article, we discuss some of the ways Ruby on Rails can help you in rapidly building fully-featured web-based applications. 1. Rapid Development and Prototypes Issues caused by old techniques When developing a website for a client, I want to concentrate on the clients needs i.e. the domain problem at hand. Asset Pipeline for Dummies - coderberry. The Rails asset pipeline is very powerful, but often misunderstood.

Asset Pipeline for Dummies - coderberry

At the Utah Ruby User Group, most of the attendees aren’t sure how to use it fully in their Rails app. It’s considered as one of the magic features that Rails offers. I admit that I was confused as well and took it’s magic for granted. Not any longer. I reference the word asset a lot in this article. In this article, I want to simplify the asset pipeline so it is better understood.

Purpose The asset pipeline has three goals: precompile, concatenate and minify assets into one central path. Moving Parts The asset pipeline is powered by two technologies: Sprockets and Tilt, the latter being a dependency of the former (look at your Gemfile.lock if you don’t believe me). Sprockets performs the asset packaging which takes the assets from all the specified paths, compiles them together and places them in the target path (public/assets). Tilt is the template engine that Sprockets uses. How to Create a Blog from Scratch Using Ruby on Rails. Ruby on rails - How can I display every 4th product with different markup. ActionView. The TextHelper module provides a set of methods for filtering, formatting and transforming strings, which can reduce the amount of inline Ruby code in your views.

ActionView

These helper methods extend Action View making them callable within your template files. Sanitization Most text helpers by default sanitize the given content, but do not escape it. This means HTML tags will appear in the page but all malicious code will be removed. Let's look at some examples using the simple_format method: Links - link_to image_tag with text in rails. A Wealth Of Ruby Loops And Iterators. I remember when I first started looking at Ruby, I’d be browsing some code and see yet another way of looping/iterating over stuff.

Whenever that would happen I would think, “…Ruby sure has a lot of different ways to iterate over things”, but I also remember wishing that someone would just put all the different ways to loop and iterate over stuff together so that you don’t have to discover them in a piecemeal fashion. Most resources I’ve seen tend to gloss over this a little bit by introducing the while loop and the each iterator and quickly moving on to more interesting things, expecting you to discover the rest on your own (nothing wrong with that by the way). As you may have guessed from my recent posts on Ruby method arguments (and more advanced method arguments), the Ruby case statement and others, I am kind-of discovering Ruby in my own way and looking more closely at things that I find of interest. Learn Ruby, Ruby on Rails tutorial.

Ruby on Rails is the web development framework of the moment, powering GitHub, Twitter, Hulu and many more successful apps and websites.

Learn Ruby, Ruby on Rails tutorial

The arrival of Rails 4 is the perfect time to learn it.