Articles

Multiple actions on one form

By using form tag we can define a action where we can submit the data and proceed further.
Now there are multiple submit button on the form and each required different action. So how to do that?
I found one easy solution for the this.

.....

function [...]

More Rack::Shell goodies for all Rack worshippers

Rack::Shell got a lot of attention lately and I received some feature requests/ideas from great ruby hackers. Daniel Neighman, currently working on Pancake, pointed me towards Bryan Helmkamp's rack-test. This awesome piece of code is now used by racksh to simulate HTTP requests to your Rack application. Yay!

hash method in ruby

I did not know about hash method in ruby object and I paid a heavy price. While developing admin_data plugin I proposed to pass certain values in configuration like this.

ensure method in ruby

Here is code.

def hello
    yield
  ensure
    puts 'in ensure block'
    true
end

puts hello { puts 'world'; false }

I thought if I call hello method then the final returned value will be true. The common ruby convention is that last value gets returned. In this case the very last value is true so I was expecting true to be the returned value.

If I execute above code this will be the output.

Clearing out Rails Sessions

As I’m sure you’re aware, Rails can be told to use ActiveRecord (and hence the MySQL database) to store session data. (New Rails apps use the cookie store by default—See the rails sessions guide for more info on both.)

However, this session data is never deleted, which means your session table continues to grow and grow forevermore. Your old sessions are left stored in the database, and although the table is indexed to help with finding sessions, it will eventually fill the disk up.

Retrospectiva: Open Source Project Management Rails App

retrospectiva.pngRetrospectiva is a new open-source project management tool built as a Rails application. It's interesting from two angles: first, as a project management tool, as it was designed; but secondly as a large, well built Rails 2.3 app to learn from.

Jammit: Industrial Strength Asset Packaging for Rails Apps

jammit.pngEarlier this year on Ruby Inside, we wrote about Sprockets - a Ruby library from 37signals that could take the various JavaScript files used in your project and compress them down on the fly into smaller portions to be more easily sent over the wire.

Use of Dirty Objects

Uses of Dirty Objects

Developer have some confusion that how they can get the previous value of the field after update.
So here the rails has a way called Dirty objects.

You can found Module Dirty in rails/activerecord/lib/active_record/dirty.rb
This is just for track unsaved attribute changes.
There are few methods in dirty module as below
* Changed
* Changed?
* Changes
* Included
And it has some constants

Mi-Fi 1.1 in AppStore Now and what I learned along the way...

During 360idev (Sept 27-30) I wrote a small app to check the battery and connectivity level of my Mifi Card. I didn’t think many people would have an iPhone and a Mifi card. The iPhone is already 3g, but effectively there is not tethering allowed and the AT&T network is crapy.

Expiring an entire page cache tree atomically

As you’ll all know, Rails has page caching baked right in – the first time an action is hit, it writes a html file of the result to the filesystem. Subsequent hits are served direct from the html file at high speed by the web server without ever involving your Rails app.

Expiring the cache is just a case of deleting the html file. But what if you want to expire an entire tree of cache files? Say you change something in a header or footer, so every single page needs expiring at once.

Senior Rails Developer – Join the Brightbox team! | Rails Fire

Senior Rails Developer – Join the Brightbox team!

We’re currently looking for an experienced and motivated Senior Rails Developer/Project Manager to join our development team here at Brightbox.

You’ll work closely both with our Development and Technical Teams to develop our customer control panel and other backend systems. We’re looking for someone who, in addition to being a great coder, will be an integral part of the team and an organised and enthusiastic project manager.

The role is full-time and you can work from home, from our office in Leeds, or a bit of both (the rest of us do a bit of both).

Send a hello, a CV and salary expectations to jobs at the Brightbox UK domain. CVs should be in an open format, preferably PDF or plain text. Closing date is Friday 11th September 2009.

As always, recruitment agents should e-mail our special recruitment company email address: root@localhost

Job Description

  • Work under the Technical Director and with our other developers to:
    • Maintain and extend our “cloud” management systems
    • Maintain and extend our billing system
    • Build the front end for our next generation of deployment systems
    • Help with application consultancy (advising customers how to design and scale their apps)
    • Work on side-projects that help the community and promote Brightbox (such as isitruby19.com)
    • Extract code to be shared with the community as open source/free software
    • Invent and develop new ideas for services and products
  • Project manage several concurrent projects
  • Work from home or our office in Leeds

Qualifications

  • Great Ruby on Rails coding skills
  • A track record of implementing live RoR sites
  • Experience of test driven development using RSpec
  • Experience of deploying Rails using tools such as Capistrano
  • Experience of project management desirable
  • Proactive developer able to work independently as well as part of the team
  • Suited to working in an agile, flexible environment
  • Good written and verbal communication skills
  • Living within 2 hours of the UTC time zone
Images: