Dreadlocks

Dreadlocks maintenance

Thinking in URLs helps you solve web-related problems in the right way. Exhibit A: If you deploy to a site whose view fragments are already cached in memcached, its likely that Rails asset caching view helpers will not be called and CSS bundles will not be generated. This whole problem is easily solved by using controllers to do what the y do best. Views and helpers should not generate URL based resources. Controllers should generate and cache assets, not view helpers. The re are many ways the controller API could be improved. Existing attempts have failed to achieve wide adoption because the y have tried to handle controllers, views, and models all at once Instead, I dreadlocks maintenance a more limited, controller-only approach could work better. The first is already in wide use: Sinatra. Sinatra is arguably the most widely replicated Ruby web framework, having inspired implementations in, Clojure, PHP, Scala, and many o the r languages. Part of the problem with writing a routing API is finding a way to describe multiple URLs in a single string. This problem is solved if you handle each URL on its own. The res no middle routing layer with arbitrary action names. HTTP method and URL are all you need but handlers can filter on the user agent or o the r header information. Thanks to Rack, Sinatra apps can be embedded in Rails applications. Or, Carl Lerche is writing a Rails 3 plugin that provides this syntax to Rails controllers Jamis Buck introduced an implementation of REST as a plugin four years ago. Yet unlike o the r areas of Rails that have seen massive improvements, Rails implementation of REST is basically the same as it was in Rails A halfway approach could combine elements of the Rails 3 router syntax with the class method style of configuration thats already familiar to Rails developers. Class method and HTTP-style methods. class ReportsController AppController beforefilter:au the nticate resource/api/v1/reports/:id get :collection do end get :member do id end put :member do id end end Variations on this syntax could easily accomodate nested resources, singleton resources, or o the r custom URL schemes. For several years, Rails has charged forward and defined new, innovative syntaxes for writing web applications. Its time for it to happen again. An improved syntax could get rid of stale controller actions, reduce confusion, reduce duplication, and improve the way we think about solving technical problems with web applications. I think the mere fact that a controller can be generated means that code shouldnt be the re. The res no intelligence in code that can be generated from a single resource name. you have a lot more room to raise the abstraction level and dreadlocks maintenance getting declarative. I think making the controller more declarative is probably the end goal. Instead of the bulk of each action being an imperative mess, the controller can be heavier on the class-level configuration thats really proven itself in the model associations, scopes, plugin configuration, etc. class-level configuration directive in Merb/Rails 3 is a signal that controllers can head in this direction. Thoughts and reactions? Reply to topfunky on Twitter, write a blog post of your own, or comment at Hacker News. Video of Reg Braithwaite at RubyFringe. Quote is about 15:30 in. The original version by David Heinemeier Hansson, the n by Ulysses, the n by Koz and Jamis Buck toge the r, and most recently by Yehuda Katz, Josh Peek, and the Rails 3 team. Sample controller code. Versioning and expiration of assets are easily solved by storing a version number in the application and appending it to the link tag. Freedom of information request into 21 incidents where UK forces shot Afghan civilians rejected by MoD officials The British Ministry of Defence yesterday refused to disclose any details of its investigations into the shooting of innocent civilians by troops in follows the disclosure in the Guardian of the existence of 21 separate such dreadlocks maintenance which have apparently been covered up. The cases emerged following the publication by WikiLeaks, the whistleblowing website, of thousands The British Ministry of Defence yesterday refused to disclose any details of its investigations into the shooting of innocent civilians by troops in Afghanistan. This follows the disclosure in the Guardian of the existence of 21 separate such cases which have apparently been covered up. The cases emerged following the publication by WikiLeaks, the whistleblowing website, of thousands of classified US military field reports. The se included accounts of units of the Coldstream Guards and Royal Marines firing on civilians. In one case, on 21 October 2007, US soldiers in Kabul reported that a gunner on top of an unidentified UK vehicle wounded three civilian interpreters in a private security company vehicle.

  1. No comments yet.
  1. No trackbacks yet.

Leave a comment