Author Archives: mexicanratdog

Ruby RVM and TK/TCL

I find myself having to repeat ruby installation processes over and over (and researching them over and over).  Enabling tk bindings in Mac OS X is one I recently repeated, so here are the instructions:

Install TCL from ActiveState

Using RVM install ruby with pthread: rvm install 1.8.6 --enable-pthread
You can now use require 'tk' in ruby.

CSS Floats Explained

For the longest time, for some reason or another, CSS floats have been a mystery to me.  I tend to just float something, add some clears around it, and see what happens.

I recently found a great tutorial explaining how the float and clear CSS attributes work.

[Quotes] What to Do?

“Don’t ask what the world needs. Ask what makes you come alive, and go do it. Because what the world needs is people who have come alive”

–Howard Thurman

Indentity Crisis

For the longest time, I have been trying to get away from M$ products and my dependence upon them.  My blog, however, continues to generate a majority of its hits from just a few very specific articles on Microsoft SharePoint.  It seems that I will have to do a lot more blogging to steer myself away from this unwanted association!

[Quote] Taking Action!

Conditions are never just right.  People who delay action until all factors are favorable do nothing.”
– William Feather

[Quote] Being Self-Taught

“Very few men are wise by their own counsel, or learned by their own teaching.  For he that was only taught by himself had a fool for his master” –Ben Johnson
It is a strange facet of the Western culture to value self-reliance so much.  With the age of the internet comes the anonymous sharing of a vast wealth of information.  How does one effectively share experience in the digital age?  Many times, I feel like I want to call someone for a recipe rather than going to allrecipes.com.  How can I learn how to clean my house’s boiler heater or fix my car from YouTube?  Believe me, I’ve tried both unsuccessfully.
I would like to be less independent.  Isn’t that strange to hear?  Doesn’t that feel like laziness?  I think it is feeling more and more like true connectedness and community.

[Quote] The Mind is Powerful!

Our best friends and our worst enemies are our thoughts.  A thought can do us more good than a doctor or a banker or a faithful friend.  It can also do us more harm than a brick.

–Frank Crane

How true this is!  How many times have I been prevented from doing something simply because of a doubtful or fearful thought?  How powerful and empowering are ‘true’ and ‘right’ thoughts about our self and others!

[Quote] Living in the Present

Men spend their lives in anticipation, in determining to be vastly happy at some period when they have time.  But the present time has one advantage over every other — it is our own.  Past opportunities are gone, future have not come.

–Charles C. Colton

[Quote] Challenging the Status Quo

If we all worked on the assumption that what is accepted as true really was true, there would be little hope of advance.

–Orville Wright

How different would all our lives be if Mr. Wright hadn’t challenged assumptions about the possibility of flight?

[MonoRail Help] Custom Views for Scaffolding

I just downloaded the latest version of the Castle MonoRail assemblies.  For a while, I have been wary of using the Scaffolding for controller and View because the views seem to stumble over nullable data types in the Model classes.  While that seem to still be a problem (maybe I’ll write a patch for it), I have started to use Scaffolding for the controllers and the customizing the Views.

Here are a list of the parameters available in the PropertyBag along with the names of the files you should create.  I’m using NVelocity, so my views end with the .VM extension.

List View

View Name: List.vm
$Items : a listing of all the records for the given model

New View

This is the view that collects information for a new record.  The form action should point to the Create controller action.

View Name: new{classname}.vm  (e.g.: if you have a model called Study, your view name will be newStudy.vm)
${classname} : is the item that you’re editing.

When creating for elements, you should name them with the format name=”classname.propertyname” (e.g.: for the Study model, if I have a property called Name, then I should add a form element with the name “Study.Name”.

Create View

There is none… this controller action just redirects to the list view after the new record is created.

Edit View

View Name: edit.vm
Query String:
id : the primary key of the record (I’m not sure what happens with models using composite keys)
The form elements have the same name format as the Create view, which is name=”classname.propertyname”.

[I'm still working to gather information on the child collection properties and the available options for those collections]

Confirm View

This is the delete confirmation view.  I usually use the JavaScript ‘confirm’ method and the do a redirect to the delete action.

View Name: confirm.vm
$classname : the record to delete
QueryString:
id: the primary key of the record to delete.

Remove View

There is no view for this action.  The controller just redirects to the list view.