Saturday, January 21, 2012

.Net's AutoPostBack property in Rails 3

In this blog introduction, I mentioned that - “Ruby” is pretty and comfortable as my old Girlfriend! But in many cases I still miss my old friend “.Net”

AutoPostBack - this is where I miss my dude!


In ASP.Net we use this property to Get or Set a value indicating whether a postback to the server automatically occurs when the user changes the control selection.

We set this property to true if the server needs to capture the selection as soon as it is made. For example, other controls on the Web page can be automatically filled depending on the user's changes from a Control.

This property can be used to allow automatic population of other controls on the Web page based on a user's changes from a Control. And the value of this property is stored in view state.

AutoPostBack and Rails 3
Unfortunately, We don't have such property for controls in RoR!  But we've some alternative approachs
  1. Adding an OnChange() javascript function to Controls
  2. Using an Observe_field or Observe_form
But a bad news is, Observe_field or Observe_form is deprecated or moved from the latest stable version. The last existing version is v2.3.8

So, I've only option to use is OnChange() javascript function! or I can make use of my new girlfriend JQuery!

Friday, January 20, 2012

.Net's Event Bubbling Concept in Rails 3

Coming soon..

Platform Dependency (Case sensitivity, URL, and JSON) problems of Rails

Coming soon ...

Rails Installation in Windows


I know many beginners feel this topic as painstaking process, as per my familiarity with her (Ruby) she feels more comfortable with Linux than Windows.  She behaves quite differently in Windows and Linux; while dealing with Case Sensitivity, URLs and JSON.

In subsequent posts, I’ll discuss about problems in terms of Case Sensitivity, URLs and JSON and solutions to avoid them.

Before we start with Rails Installation, let me list down the necessary ingredients for this.
  1. Ruby (Be careful with version).
  2. Ruby Gems - is the standard Ruby package manager.
  3. Rails
  4. Sqlite
  5. MySQL - a Database server
  6. MySQL Workbench - an unified visual tool for developers which provides data modeling, SQL development, and comprehensive administration tools for server configuration, user administration, and much more.
  7. Editor - an IDE for RoR.
So, Lets start with Rails Installation process with our old good looking buddy Windows!

For installing Ruby,Rails and Sqlite we've a easy-to-use installer for Windows called RailsInstaller. By using this you get all the common packages needed for a full Rails stack. so get ready for this!

  1. Go to Railsinstaller and download the latest KIT
  2. Run the installer and follow the installation steps or you can watch the following video so you'll see the simple installation process and how to confirm that Ruby, Rails, Git, etc are all installed properly

RailsInstaller walkthrough, including interacting with Github and the Engine Yard Cloud free trial.



Hey that's great! you've got everything installed. You've written some code. If you have any troubles in Installing, Check the Rails Installer Google Group. 

For MySQL and MySQL Workbench  we've another  wizard-based installer for Windows called MySQL Installer.
  1. Go to MySQL Installer and download latest release
  2. Run the installer and follow the installation steps 
And finally, we need an IDE, for this I prefer Aptana Studio. you can download the latest release here