Archive for the 'w2task' Category

Keeping session data across subdomains in Rails 2.3.2

Upgrading to Rails 2.3.2 I came across with the error of not keeping the session data between subdomains. That meant I had to authenticate each time I would change the subdomain.

The fix is simple.

Prior to version 2.3.2, I have had something like this in environments/development.rb file:

ActionController::Base.session_options[:session_domain] = '.w2task.local'

In Rails 2.3.2, I had to change this line into:

config.action_controller.session = { 
  :domain => ".w2task.local" 

Of course, same principle applies to development.rb, where:

config.action_controller.session = { 
  :domain => "" 

I’ve lost some hours in researching this solution, so I hope this will help others in need. too. As usual, I will be more than happy to hear comments from you.

Happy coding!

W2task – screencast

This is my first attempt to create a screencast, related to my project. Comments are welcome.

For a higher resolution version, please check W2task screencast on

Update. I have posted a flash version, too. Enjoy.

w2task – Does anyone have any suggestions how to improve the workflow after the user signs up?

The user starts with the sign up screen. Pretty easy and straight forward:

But, after filling in all required info, the new user is thrown up into a screen like this:

I know, it is not friendly at all, that’s why I am waiting for some suggestions. Basically I am thinking to replace this screen with a message to explain that the user should create a business or to collect its id number and give it to a business administrator to be added to an existing business?

What to you think?

Original topic started on support section of –

The Week in Review

A new week is starting in force. But before that, let’s go quickly through the week just passed. Yes, you’re right, I’ll focus on next paragraphs on the Wednesday’s event DemoCamp Dubai 4th edition, the first demo camp on which I have been not part of public, but of the presenters.

The event itself had part of great media coverage, and here I’ll have to mention Shuttlegazine, The National, Startup Arabia,

Demos, as usual there were four:

  1. – an iPhone application used to complement and give mobile access to a well known real estate portal which covers Dubai properties. It has been created by the guys behind SpinBits.
  2. StartUpArabia Database – a moderated wiki like database dedicated to Arab technology startups, entrepreneurs and financial organizations that anyone can edit and enrich. Most of all, Moh’d Marwan Meddah put his soul in creating, proving that in a selfish world, it is not necessary to be selfish yourself to win.
  3. eMapia – eBay and Google Maps combined, a niche web application providing a way to getting in direct contact the buyer and the seller.
  4. w2task – a web based task and time management system. This has been presented by myself – a truly amazing experience. Not everything worked according to the plan. It took me a while to synchronize the pitch of my voice with the levels of the sound system, often sounding either too loud or too low. This, of course, had a domino effect in my presentation spirit, making me quite tensed.

However, although I am taking note of the above imperfections, I would mark the above event as an achievement, especially because of the great feedback which demonstrated that such type of applications can have a great future. As I’ve seen in the National due to recession, when big companies are cutting down on budgets and on projects, it can be a lifetime opportunity for startups to play from the same level with the well established companies.

In development terms, that means I would stabilize the base code of w2task, improve the workflow and make it more appealing for the first time user, when no data is present.

Let me conclude with the greeting posted on Twitter:

Good morning! It is time to start in force a great new week!

Coding Aloud – Restricting your users to edit other’s profile

restful_authentication plugin made its way to my projects as the “de-facto” authentication system in my Ruby on Rails projects like w2task or I would not insist on how to install it, as it is well explained on its home page at github.

What I want to show is that in particular instances we may not like that one user can access and modify other user’s profile. For example if I try to edit my profile, the URL will end in something like users/2/edit and if I would change it to users/1/edit then I am able to modify this user – most often an undesirable fact.

Here is my workaround:

  # ...
  def edit
    if params[:id].to_i ==
      @user = User.find(params[:id])
      flash[:error] = "Not allowed!"
  # ...

That’s pretty much everything I need to change.

What is your preferred solution? Are you doing these tests into a – perhaps – before_filter?

w2task Challenge

I would like to introduce my latest project w2task – a web application written in Rails.

w2task challenge

It is a task and time management web based software. At this point, a registered user can create its own business (company) and define a series of projects. Then, the user can record its own efforts and attach them to a particular project. The sidebar (Efforts Bar) gives a quick statistic regarding the number of efforts and total timing. Also, by clicking on a particular project you may get the timesheet of the particular month.

You may well give it a try, here is the link: Don’t hesitate to tell me your opinion about it, right here as a reply to this post. You may me as harsh as you want, it is constructive and ultimately this blog is moderated 🙂 .

Be warned, this web app is still in its early, early development stages.

To better understand the philosophy behind this application, the strength and the weaknesses of the application, allow me to tell you in few points a bit of my history with Rails:

  • January 2008 – I’ve bought my first Rails book Agile Web Development with Rails, but I didn’t have enough time to practice it that Rails, turned 2.0 and broke the compatibility with 1.x versions. I remember the headaches regarding the scaffolding, so I abandoned my Rails path.
  • May 2008 – I’ve make up my mind and bought the third edition of the above book and start again with Rails at a low pace.
  • October 2008 – my friend Hossein asked me to join in a web project with a real estate portal. I thought it is the moment to put my knowledge into practice and this his how got wind. Ok, the real estate market is down now (dec 2008 – jan 2009), but shines 😉 .
  • November 2008 – Dubai Hacking Night – where I meet again my heroes: the SpinBits guys which encouraged me to learn Rails. I have shown to Rida a sketch of w2task (a scaffold and some CSS files) – a Ruby on Rails practicing project and he asked me to promise that I will present it on DemoCamp 4, which should be in mid January 2009.
  • December 2008 – I have closely followed 37signals blog and read their book – Getting Real. Truly inspiring, and I am thinking to copy their business model.
  • 2009 – here we are.

Wow, getting long with this post. However, for the future, I have a lot to say and I hope it will be of interest for my blog readers, as I will fly along the Rails.