On Jul 7, 2005, at 11:04 PM, Neville Burnell wrote:> Is there a summary detailing "old form expression" deprecated by
> "new form expression" ?
>
> This would be really useful to make sure various legacy idioms [in
> my apps ;D] get updated to the "Right Way ™"
Briefly, prefer methods and symbols over instance variables and strings:
params[:foo] over @params["foo"]
request.request_method over @request.request_method
session[:user_id] = user.id over @session["user"] = user
Prefer the new render method to the old render_* methods:
render :text => ''foobar'' over render_text
"foobar"
And use normal Ruby assertions instead of the old custom assertions:
assert assigns(:itinerary).valid? over assert_valid_record
''itinerary''
A poor summary, but it''s a start.
jeremy