I saw a demo of the new Ember Router on Thursday night, and it looks to be a huge improvement over the existing state machine + router system that is currently used, much closer to the magic the Rails uses. No release date yet (when I asked, Katz said that some of the stuff he was showing only existed on his laptop yet…), but really looking forward to it.
So if your having a hard time pulling requirements out someone, make up a bunch of shit so they can rip it apart. In the end, you may actually get what you were asking them for.
Check out this post:
and accompanying JSFiddle from the accepted answer:
Not especially the way the router handles the actions coming from the views, and then delegates them out to the controller, which then delegates back to the router to change state.
The problem - click on the button in my form, and the action in my view doesn’t get called. Beat head against wall for an hour.
The default target for an action is now the router, not the view, so if you want to put a specified handler in you view or controller, you now need to add a ‘target=”view”’ or ‘target=”controller”’ as part of your action. Check out http://stackoverflow.com/questions/11050956/ember-js-router-action-to-controller for full details.
Be sure to use the proper type of controller, or else none of your data will show up. If in connectOutlet you are passing an object, use Ember.ObjectController, if you are passing a list, use Ember.ArrayController. If your data doesn’t appear to be displaying where it should be, check this.
One hour gone….
In ember, name your ‘outlets’ in camel case, don’t use underscores, the magic doesn’t work with underscores.
itemTitle, not item_title
I’ve started a new project converting an existing server based web project over to a snazzy client single page based application. After playing around with Backbone.js I’ve decided to move over to ember.js, as this is quite a large application, and Backbone isn’t going to cut it (at least without adding a bunch of add-ins). So prepare for a bunch of ember.js learnings posts - yes, those ‘duh, I’ve been staring at this code for an hour and just found my stupid mistake or figured out the quirk that I hope I don’t ever forget again’ type posts.
You are warned.
OK, that was just three hours of my life sucked into oblivion. I’m I doing something really stupid, or is MySQL Administrator really that broken?
So what I was trying to do is get long query logging in MySql to work. Don’t use the MySQL Administrator to do this! Just edit your C:\Program Files\MySQL\MySQL Server 5.0\my.ini file, and add the following to the end of the file (in the [mysqld] section)
- log-slow-queries=[log filename or blank for default]
Thats all there is to it. Do not try and put it in the [mysql] section. Do not try to use the GUI, which will put it there, but won’t read it unless you change the section name to [MySQL]. Do not think, just do as I eventually did…
And then life is good…
doesn’t appear to like to try and get you zero rows - throws an exception. Guess that kind of makes sense, but lesson learned is trap for this condition before hand or catch the exception…
No idea if this is normal behavior, but I am using a ‘DetachedCriteria’ in a search object. I want to generate a page of search results, so I need both the total rows returned as well as the slice of the data for this page. So, generate a DetachedCriteria for the where clause, use a ScalarProjectionQuery to get the total count, and then a SlicedFindAll to get the page. I DON”T THINK SO! Using the DetachedCriteria in one query seems to mess it up for the next query, so I end up making to copies of the where clause, one per query, and it works fine. WTF! Bug or feature? I don’t know, just beware if you are doing the same and getting funky errors.
Or do I blame NHibernate? Big and complicated, huge learning curve. Once I get over it, I may love it, but until then, it’s more swimming in mud….
So don’t believe what you read in the documentation. With the latest version of ActiveRecord, you don’t need to us NHibernate.Generics - NHibernate 1.2 has build in support (see the Iesi.Collections.Generics classes). So that one only cost me a half day. I am having a real love hate relationship with Castle ActiveRecord, maybe I should be switching back to Rails…
4 cents. Got to love this service….
It was a very intesting conference. Small - only 240 people, which was very cool, as everybody fit in one room, and you had contact with everyone. That’s what it was really about, networking, meeting new people, and just getting a little bit connected. I’m still digesting the content. The morning speakers were all good, but I have to admit, I don’t remember much from the afternoons, and I didn’t take that many notes in the afternoon. More later….
I’m off to Denver for the Defrag conference. Should be interesting, as this is my first real ‘tech’ conference. I big gathering of geeks trying to figure out the next big thing, hopefully I’ll come away inspired…