{{{ Rails comes with a massive amount of helpful gems. Those gems are part of Rails’ success and they make Rails the most versatile framework in the Ruby world. No longer shall using those gems be limited to a Rails environment! The new “Cells 3.8.5”:https://github.com/apotonick/cells allows using many gems in any project, from simple scripts… Continue reading Using Rails Gems Like simple_form in Sinatra Or Anywhere
Tag: Cells
Maximum Modularity with Cells and Rails Engines
{{{ Do you remember “when we were writing a reusable sidebar element”:http://nicksda.apotomo.de/2010/11/lets-write-a-reusable-sidebar-component-in-rails-3/ some time ago? The sidebar used in many controllers was implemented using a “cell”:https://github.com/apotonick/cells which encapsulated both assets and code in one place. Those were good times. When needed, we could render the box with a @render_cell@ call anywhere in our app. #sidebar… Continue reading Maximum Modularity with Cells and Rails Engines
Filters For Your Cells with cells-filters
{{{ There’s nothing like giving a quick update about “Cells”:https://github.com/apotonick/cells on a rainy sunday evening. Almost a year ago we were happy “to introduce state-args into Cells”:http://nicksda.apotomo.de/2011/02/cells-3-5-release-party-summary/. State-args help to prevent saving state in instance variables and instead pass variables from @#render_cell@ as arguments, making your code more explicit. One big problem was that filters… Continue reading Filters For Your Cells with cells-filters
Mounting a Cell to a Route with Cells 3.8.
{{{ Those of you “having asked for mountable cells”:https://github.com/apotonick/cells/issues/15 will be happy with the recent “3.8.0 release”:https://rubygems.org/gems/cells/versions/3.8.0! We entirely removed the ActionController dependency. That essentially means you can have cells outside of the standard Rails stack. Cool, heh? h3. Cells 3.8.0 Released Two little things in 3.8 changed. @Cell::Base@ and @Cell::Rails@ are now different classes… Continue reading Mounting a Cell to a Route with Cells 3.8.
Cells 3.7 released, taataa.
{{{ Is it a good sign when a minor release doesn’t yield any stunning new features? When there’s nothing breathtaking to talk about? I guess with Cells it is – the gem finally seems to get into what it should have been 6 years ago: a mature view components framework for Rails. The “3.7 release”:https://github.com/apotonick/cells/commit/0c0aeedd3d05de571d8265bc2d3bc2582c370a53,… Continue reading Cells 3.7 released, taataa.
Rails Misapprehensions: Helpers are shit.
{{{ When I started using Rails years ago I found helpers extremely cool. I could call a method in a view and it would _help_ me by doing something. The method was simply there, *no need to worry about its source* and how to access it, just call it. I got older, wiser, and more… Continue reading Rails Misapprehensions: Helpers are shit.
Folks, here is the Cells Cheatsheet 1.0!
{{{ Why didn’t I do this earlier? “Here’s the official Cells cheatsheet”:http://cells.rubyforge.org/pdfs/cells_cheatsheet-1.0.pdf with all the information you need at hand when writing sweet view components in Rails. It discusses the following topics. * Generator * Options processing * Rendering * Control Flow & Initialization * View Inheritance & Builders * Caching * Configuration * Test::Unit… Continue reading Folks, here is the Cells Cheatsheet 1.0!
Rails Misapprehensions: The Dependency Injection Pattern
{{{ Inspired by the “Stop hating Java”:http://andrzejonsoftware.blogspot.com/2011/07/stop-hating-java.html post by my friend Andrzej I started to identify the pros and cons of a pattern called _Dependency Injection_ in the Ruby/Rails world. Before I explain the pattern, let me discuss the problem – a dependency. h3. What is a Dependency? Let’s say we’re working in a casual… Continue reading Rails Misapprehensions: The Dependency Injection Pattern
Cells 3.6.0 released – Rails 3.1 here we go!
{{{ Just released “Cells 3.6”:https://github.com/apotonick/cells – Cells are view components (aka portlets or widgets) for Rails. The new version runs with Rails 3.0 _and_ 3.1 and it has no cool new features! The “view inheritance code”:https://github.com/apotonick/cells/blob/v3.5.6/lib/cell/rails.rb#L146 got obsolete for 3.1 since Rails itself implements it, so “Andrzej Krzywda”:http://andrzejonsoftware.blogspot.com/ and I decided to introduce a “Strategy… Continue reading Cells 3.6.0 released – Rails 3.1 here we go!
Rails Misapprehensions: Caching Views is Not the View’s Job!
{{{ Caching is a generic approach to speed up processing time in software. A common pattern used in Rails is to *cache already rendered markup to save rendering time*. Basically, there are two concepts for view caching in Rails. * *Page caching* saves the complete page. This is good if your page doesn’t have dynamic… Continue reading Rails Misapprehensions: Caching Views is Not the View’s Job!