Fear Of The Class: Fat Model Kills Your Software Design.

{{{ You are following the “Fat Models, Skinny Controller” pattern in Rails. Your controllers being the HTTP endpoints are nice and clean. Short action methods and brief assignments. However, your models keep growing and growing, you are losing track of its responsibilities and you are trying to figure out why. That is a problem. Rails… Continue reading Fear Of The Class: Fat Model Kills Your Software Design.

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

Ruby on REST 4: Using Representers in Rails

{{{ It has been a while since I blogged about “Roar”:https://github.com/apotonick/roar and it’s representers – “beautiful South Africa”:http://rubyfuza.org/speakers?page=2 kept me from doing my homework. Nevertheless, in the meantime, the new “roar-rails gem”:https://github.com/apotonick/roar-rails emerged bringing together Rails and Roar in a very easy going way. I’d like to describe how this gem works by implementing a… Continue reading Ruby on REST 4: Using Representers in Rails

Rails Misapprehensions: Rails needs more abstraction layers!

{{{ Recently, my github news feed got spammed with “comments on a commit in rails/rails”:https://github.com/rails/rails/commit/9f09aeb8273177fc2d09ebdafcc76ee8eb56fe33#comments. People are arguing about *a new abstraction layer named _coffeescript_* for generating JavaScript. Is there a way to filter that kind of stuff? I’m all for discussions but not stupid 176 comments like “_+1 Awesome core!_” on github. Do that… Continue reading Rails Misapprehensions: Rails needs more abstraction layers!

Rails Misapprehensions: Understanding RESTful PUT and POST

{{{ In the last post “I talked about the rest in REST”:http://nicksda.apotomo.de/2010/12/rails-misapprehensions-rest-is-more-than-get-post-put-and-delete/, beyond the four major verbs. Before getting completely wasted at the tonight’s new year party I’d like to quickly *illustrate my understanding of two HTTP verbs and how to think about them* in a RESTful mind. While *GET and DELETE are pretty obvious*,… Continue reading Rails Misapprehensions: Understanding RESTful PUT and POST

Rails Misapprehensions: REST is more than GET, POST, PUT and DELETE!

{{{ “CRUD is not REST”:http://nicksda.apotomo.de/2010/10/rails-misapprehensions-crud-is-not-rest/ is what I was trying to clarify in my last restful post. There surely is a terrible confusion in the community about that. * *CRUD is implementation* where you simply could pull in some module into your controller and get a CRUD interface for free. * *REST is an implementational… Continue reading Rails Misapprehensions: REST is more than GET, POST, PUT and DELETE!

Pragmatic Rails: Write RIAs, not websites!

{{{ Dude, I was googling for _”RIA and Rails”_ recently. Latest posts were dated 2007. Oh wait, there’s “one”:http://raibledesigns.com/rd/entry/groovy_rails_with_components_ria from 2008 basically stating *”Rails needs components”* – which is “nothing new to me”:http://nicksda.apotomo.de/2010/10/10-points-how-cells-improves-your-rails-architecture/. h3. What’s a RIA? A RIA nothing more than an acronym for Rich Internet Application. What’s that, again? * Usually that’s a… Continue reading Pragmatic Rails: Write RIAs, not websites!

Pragmatic Rails: Let’s do AJAX-backed Sidebar Widgets right, Jim!

{{{ Days ago “I explained how to write a sidebar widget in Rails”:http://nicksda.apotomo.de/2010/11/lets-write-a-reusable-sidebar-component-in-rails-3/, using the view component framework “Cells”:http://github.com/apotonick/cells. This was fun. Clicking a tag leads to a page reload, where the _Recent posts_ list *displays items matching the tag*, only. It worked great, however, each click needs a real HTTP request and a reload… Continue reading Pragmatic Rails: Let’s do AJAX-backed Sidebar Widgets right, Jim!

Rails Misapprehensions: What the fuck is MVP?

{{{ People usually make me feel slightly embarassed when they ask things like *”How does Cells handle MVP?”* or, even better, *”Is there any MVP _implementation_ in Cells?”*. Frankly, *I don’t have a fucking clue about the _real_ differences between MVP and MVC*. In the past I usually deflected people’s attention by buying beers instead… Continue reading Rails Misapprehensions: What the fuck is MVP?

Rails Misapprehensions: Cells don’t break MVC

{{{ I was posting “a stupid simple example how Cells can be used”:http://nicksda.apotomo.de/2010/10/why-rails-controllers-need-a-double-render/ the other day. This controversial post got lots of great comments, thanks to all! While some just questioned Cells and its use, a few *comments really bashed the project* in a very aggressive way. *I like that.* The rudeness in some sequential… Continue reading Rails Misapprehensions: Cells don’t break MVC