JSON keys as symbols instead of strings in Ruby

Here’s a quickie that saved me from having to write a recursive symbolize_keys method.  I was dealing with stringified JSON in the params of one of my rails controllers.  I wanted to do the usual call to params[:foo], but when I did JSON.parse  on the string, the keys were strings instead of symbols, so I would need to do params[‘foo’] instead.  Luckily, as of Ruby 1.9, it’s possible to pass in symbolize_names: true as an option.


Rustic Canyon

Last night, Will and I finally made it to the west side for dinner. We’d been meaning to try out Rustic Canyon ever since we found out Jeremy Fox was now cooking there. It seemed like a good idea, since he’s been known to cook creative vegetable-heavy dishes and it wouldn’t be a stretch for Rustic Canyon to do some vegan dishes.


We started off with the marinated olives and marcona almonds.  The almonds flavored with sugar and lavender are said to be one of Fox’s signature dishes and it’s no wonder why. What at first smelled like a bowl of potpourri turned out to be a bowl of addictive, strangely spiced almonds.  The olives marinated with fennel, orange, and garlic were also a nice surprise. Everywhere in LA has a bowl of marinated olives now, so we were expecting more of the same, but something made these olives taste really bright and different.

DSCF1511 The beets and berries, as suggested by our server, was a slightly different take on the ubiquitous beet salad.  The dressing was overly acidic for my taste, and I like pretty sour stuff. It could have been balanced out had there been more avocado in the salad.  The addition of mint gave it an unexpected pop which I liked.

DSCF1514I also had the squid ceviche: a quirky combination of squid and melon that actually worked.  The squid was gently poached in salted water, so not a traditional ceviche.  Each piece was perfectly tender, and the entire dish was dressed well with a good balance of acid and richness from the sauce below the squid. I also liked the slightly sweet pickled slices of chili pepper.

DSCF1509We also had the focaccia with burrata and eggplant caponata. While good as a plate of bread and cheese, it wasn’t as successful as focaccia.  The top of the focaccia didn’t seem done enough and the bread was denser in the middle than I expected.  It seemed like the dough wasn’t given enough time to rise, or something.  I’m not usually one to complain about a dish to the restaurant, as long as it’s edible, but since the server asked how the bread was, I told him the truth. He assured me that this was a different “style” of focaccia, since focaccia differs from region to region and that it was meant to be rustic.  Fine. We’ve had focaccia up and down the west coast of Italy and this was not like any of the different focaccia in any region we visited.

Not pictured was a chickpea stew with tomato sauce which was really good, vegan, and tasted amazingly like meatballs with red sauce.



We also had a bread stew with tomato sauce, which tasted similar to the chickpea stew. This would have been a safe dish if not for the basil kimchi on top.  It was really spicy and unexpected, and gave what would have been a boring dish a little zing.

One of the hardest decisions of the night was picking between the Tcho chocolate cake or a scoop of sweet corn ice cream. The sweet corn ice cream won out and it was so good I don’t regret it at all.  The slightly salty, creamy, corn taste was exactly what I had pictured when I read it on the menu.  It was so good, I didn’t want to waste any time taking a photo of it.

My feeling about Rustic Canyon is a little mixed. I over heard the staff say that Fox wasn’t in the kitchen that night, so it might have been attributed to that, but I thought some of the dishes didn’t seem that balanced and leaned toward the too much acid side.  And while most of the dishes were good, nothing really blew my socks off.  I couldn’t help feeling that this was a case of a good chef and a good restaurant but neither being a good fit with each other.

Rustic Canyon
1119 Wilshire Blvd
Santa Monica, CA 90401

Accessing the same variable in a directive and controller in AngularJS

A few days ago, I was working with this type of structure in AngularJS:

I had a directive, contentTagButtons inside of an Angular controller, which was pretty basic.  I needed to be able to assign a value to a variable in the contentTagButtons directive, but still have access to it in formController. This is where directive scope comes in handy.

In my directive:


For my purposes when I set the scope attribute to false, the directive uses its parent scope. This means that $scope.someSharedVar my contentTagButtons directive  would be the same as $scope.someSharedVar in my formController controller.

Shidhin explains directive scoping in more detail in his post here.