Articles

5 Ruby-related blogs for June

Over the years, I’ve collected a fair number of Ruby blogs in my feed reader. I thought I’d start sharing them for the benefit of others (in no particular order). Here’s the first installment – I’ll list some more at a later date.

Asset_packager, boost your rails app with a simply plugin

Description

When it comes time to deploy your new web application, instead of sending down a dozen javascript and css files full of formatting and comments, this Rails plugin makes it simple to merge and compress JavaScript and CSS down into one or more files, increasing speed and saving bandwidth.

When in development, it allows you to use your original versions and retain formatting and comments for readability and debugging.

unsavory — get rid of stale Delicious bookmarks

After reading Scripting Java Libraries With Ruby on the Engine Yard

#327 | »Symbol vs String performance« in Category Performance

»Improving the Usability of Your Ruby on Rails Applications (video)«

dynamic_parameters

The params hash in Rails is special.

Finding ActiveRecord Associations

Im working away on ActiveJquery, and the next thing on the list, is to add support for relationships. This gets to be really interesting, because your Inside the box, in a plugin, and you need to know what associations the user has
defined.

I was scanning the documentation, and looking around for the api to find the information.

After searching for a while, I discovered railway, a gem for rails that does diagraming of rails models using dot. So grab the gem, and look thru the source.

So the key to finding associations is:

arrayify!

Following from my post: Array.acts_like_array?, I can now implement arrayify without using is_a? Array or respond_to? :[] && !is_a? String

class Object
def arrayify
self.acts_like?(:array) ? self : [self]
end
end

So we can now do: thing = thing.arrayify or: do_something(thing.arrayify)

Now, what I really want to do is thing.arrayify!, but I'm not sure how to implement that.

Rails Envy Podcast - Episode #081: 06/05/2009

Episode 81. We're joined this week by the awesome Corey Haines. This podcast is chock full of news and awkwardness. We do apologize for the sound quality this episode -- my one mic had a bit of difficulty picking up 3 people and keeping the levels consistent. Hope you like it!

Name that method: Symmetry

class Users < Application
  provides :xml, :json

  def index
    @users = User.all
    display @users
  end
end

Take a look at the snippet above. It’s from Merb, and the provides/display feature is something that will be implemented in Rails 3 after it was decided to merge the two projects. Don’t think too much about what it does, the point is to see how it will look in Rails 3:

14 Videos from LA Ruby 2009: Some Great Weekend Watching

larubyconf-logo.jpg.jpeg

Javier Cicchelli | Rails Fire

Javier Cicchelli

Cookie-based Sessions in Sinatra

Cookie-based Sessions in Sinatra

Julio Javier CicchelliThis is a guest post from Julio Javier Cicchelli.

Syndicate content