Rethinking Rails 3 Controllers and Routes | Free PeepCode Blog
The Rails router has been written and rewritten at least four times2, including a recent rewrite for the upcoming Rails 3. The syntax is now more concise.<br />
<br />
But never mind making it shorter! It’s time for a final rewrite: Let’s get rid of it altogether!
Related cards:
Unpoly 3.7.1, 3.7.2 and 3.7.3 released
Version 3.7.0 broke some things in complex forms. Sorry for that. Concurrent user input is hard.
3.7.1
This change fixes two regressions for form field watchers, introduced by [3.7.0](https://unpoly.com...
Nested controller routes (Rails 2 and 3)
In order to keep the controllers directory tidy, we recently started to namespace controllers. With the :controller
option you can tell Rails which controller to use for a path or resource. For nested resources, Rails will determine the view pat...
DNS debug tools
There are several tools for DNS debugging which offer you more or less information. Most of the time the more simple ones, like host
oder nslookup
will be sufficient.
host
simple DNS lookup utility.
>host heise.de
heise.de has addr...
Making the rails 3.1. asset pipeline and asset precompiling work in production mode
Recently, we had an interesting lunch-break with the rails 3.1. asset-pipeline in production mode. Daniel Zahn made a blogpost about our journey, precompiling assets, fingerprinting, Haml, Sass & Compass and what he calls "the dark heinous hutch".
Security issues with hash conditions in Rails 2 and Rails 3
Find conditions for scopes can be given either as an array (:conditions => ['state = ?', 'draft']
) or a hash (:conditions => { 'state' => 'draft' }
). The later is nicer to read, but has horrible security implications in some versions of Ru...
Rails 3: Mass assignment protection and .create_with
The issue
Yesterday, Rails fixed a security issue (CVE-2014-3514) in Rails 4+. It was possible to use .where
or .create_with
to bypass Rails' [Strong Param...
Rails routes: Extracting collection actions into their own controllers
Let's say you have two screens:
- Show a given project
- Show a report for all projects
Ideally you want both screens to be handled by different controllers like this:
GET /projects/:id => ProjectsController#show
GET /projects/...
How to view Image Metadata on the Linux Command Line with ImageMagick
ImageMagick has a command line tool called identify
which can read image metadata:
>identify -verbose DSC00136.JPG
Image: DSC00136.JPG
Format: JPEG (Joint Photographic Experts Group JFIF format)
Class: DirectClass
Geometry: 5472x3648+...
Default views in Rails 3.0 with custom resolvers
It is common in Rails 3.0 applications that you want to provide default views for a group of controllers. Let’s say you have a bunch of controllers inside the Admin namespace and you would like each action to fallback to a default template. So if ...
Make Sure Your Rails Application is Actually Caching (and not just pretending) - Alfa Jango Blog » Blog Archive
It occurred to me that many Rails/Passenger/Apache applications may have caching set up in a way that it appears to be caching, when it is not actually caching.