Share on Twitter

Personal Intro (For frequent visitors of this blog only)

Yes, I’m checking out Rails. Mainly to see what ASP.NET MVC is missing. Very initial impressions, A Lot!

Anyway, this post is intended to be found by new visitors who already know a little Ruby, so, no introductions for this time. Maybe a different post.

 

Just to set expectations, there are only 2 lines needed for getting it to work. This post is just to encourage myself to keep writing…

 

Example

So, let’s assume a simple website that ha a single controller “Say” with only one Action “Hello”.

class SayController < ApplicationController
  def hello
    @name = "محمد"
  end
end

The first time you try to add an Arabic word to any Ruby string, you’ll get the error:v

invalid multibyte char (US-ASCII)

syntax error, unexpected $end, expecting keyword_end

@name = "محمد"

To fix this, you need to tell Ruby that this file is written in Unicode.

This is done by adding the underlined text as the “first” line in the file:

# encoding: utf-8
class SayController < ApplicationController
  def hello
    @name = "محمد"
  end
end

, , , ,
Share on Twitter

Reading the news that Ruby.NET is dead although doesn’t feel the best thing to hear, is still logical, and more explicitly it’s even "right". After all, it reminded me with the other story about the death of AJAX.NET Professional. I wrote a detailed take on that earlier (in my former blog) and although you might consider this spamming, I feel the same talk needs to be brought back into conversation, because I feel like I want to say the same things, so, I’m quoting it entirely here in this blog.

Few hours ago, Michael Schwarz, the creator of AJAX.NET Professional (A.KA. AJAXPro), the most successful AJAX framework for ASP.NET after Microsoft’s ASP.NET AJAX Framework (A.K.A., ATLAS) has stated that he’ll no longer be working on the project. Furthermore, he even recommended users to move to Microsoft’s AJAX Framework instead!! The reasons Michael mentioned why he will stop the project used by 13.3% of ASP.NET developers doing AJAX work include the fact that ASP.NET AJAX is part of ASP.NET 3.5 itself, and that he believes future innovation on the client side will be in other areas not just AJAX.

, , ,