But I would certainly add a note regarding Railscast #66 Custom Rakes. You need to add this in the .zshrc file:
alias rake="noglob rake"
I was using zsh for a while when I first needed to use a custom rake command with parameters I had built. I couldn't figure what was wrong and it took me a while to see that it was not an error in the rake file.
1st look at meteor - awesome! Second look, forget it. sass does not seem to work at all, you can't customize twitter bootstrap as there is no way to customize what files are loaded in what order, ... I try it again in some years... screencast great as always!
If I'm not mistaken this allows a blank password (and confirmation) to be submitted when resetting the password, because in this case the validates_presence_of :password is only called on creation of a user.
Check your request's headers. You might see this, for example, if you're sending Accept headers to set the version but your API is routing based on path.
For those of you having problems with mini_magic, this worked for me:
ruby
defcropif model.crop_x.present?
resize_to_limit(600, 600)
manipulate! do |img|
x = model.crop_x
y = model.crop_y
w = model.crop_w
h = model.crop_h
img.crop "#{w}x#{h}+#{x}+#{y}"
img
endendend
Thanks Ryan for the examples. Some clients will use multiple Accept header values when they expect to live in mixed environments, so it would be good to put the default version higher in the routes (in the version I read just now, it looks like a client sending v1 and v2 in the Accept header will get v1).
Not sure how you would efficiently use the q parameter (i.e. Accept: application/vnd.myapp+json;v=2;q=1.0,application/vnd.myapp+json;v=1;q=0.9), as ideally the server would select the most-preferred client version that it also supports, but that seems like a lot of overhead just to get strict correctness.
Do you have any recommendations for handling errors using the correct content type within an API namespace? For example if you 404 by POSTing to /api/products/1 instead of using a PUT, you get the Rails HTML 404 page in the response because the route does not match. Same goes for 500 errors if they ever happen.
Would be nice to get a JSON response for all requests in the namespace.
It's really up to you. But we handle the single master, multiple slave setup out of the box for both PostgreSQL and MySQL. All you need to do is add a machine with the appropriate slave role (e.g., postgresql_slave) and it'll auto-configure it for async streaming replication from your master. The config is all generated in your project though, so if you want to change to streaming replication, for instance, just modify the generated file and you're good to go.
No, Meteor is still in very early development. It's API changes frequently and also I believe the whole DB is exposed to the client. I'm not 100% sure about the last one though.
Was just looking for a solution while testing a portion of an application which uses google's geocoding service. We're limited to the number of geocoding requests we can make, so I turned to VCR.
I'd swear my reading comprehension is good until I attempt to read a README (no offense intended, Myron).
This screencast had me up and running moments after watching. Thanks much, Ryan and Myron!
Ryan, thanks so much for recording this episode. Last week I worked in something similar. Just one thing, I would pass the version as a mime type parameter. Something like:
I'm keen to understad which of these rich application frameworks would be best suited for developing HTML5 mobile apps. How well do they work with offline storage and automatic synchronisation?
I love that you expose me to new technologies that I may never have checked out in my frenzy to get my work done. I'm a far more well rounded developer thanks to you.
I'm just stoked about learning about defaults on namespaces in the routes...
that's a great tip.
Hi Ryan,
thanks for this Railscast, loving zsh.
But I would certainly add a note regarding Railscast #66 Custom Rakes. You need to add this in the .zshrc file:
alias rake="noglob rake"
I was using zsh for a while when I first needed to use a custom rake command with parameters I had built. I couldn't figure what was wrong and it took me a while to see that it was not an error in the rake file.
Thanks
Fred
And the solution is download and install the 64 bit version binary Python installer from Python.org website. Here is the direct download link
Hi Ryan,
I tried the sample source code but it gives me this error. I hope you mentioned it in the notes or comments to other users to benefit.
+1
+1 to that.
+1. Would like to see an introduction to emberjs using rails.
1st look at meteor - awesome! Second look, forget it. sass does not seem to work at all, you can't customize twitter bootstrap as there is no way to customize what files are loaded in what order, ... I try it again in some years... screencast great as always!
Not being a Rails Expert, why did you wrap the different API Versions in a Module rather than just using a controller?
If I'm not mistaken this allows a blank password (and confirmation) to be submitted when resetting the password, because in this case the
validates_presence_of :password
is only called on creation of a user.have you tried using
validates_presence_of :password, on: :create
Amazing tip. Thanks!
Check your request's headers. You might see this, for example, if you're sending Accept headers to set the version but your API is routing based on path.
Cool! Thanks Ryan!
Meteor looks awesome! I would love to see another screencast on meteor, perhaps with more advanced concepts
Thanks a lot! It was driving me mad
For those of you having problems with mini_magic, this worked for me:
Yes, always.
The problem with the default is it will accept any mime type, as it will only check the boolean and not the string:
I mean, if we're expecting "application/vnd.github.v1", it will also accept "application/vnd.twitter.v1"
Can I suggest Doorkeeper for OAuth2?
https://github.com/applicake/doorkeeper
+1
I think the later is what we are talking about. the former is abandoned.
Thanks Ryan for the examples. Some clients will use multiple Accept header values when they expect to live in mixed environments, so it would be good to put the default version higher in the routes (in the version I read just now, it looks like a client sending v1 and v2 in the Accept header will get v1).
Not sure how you would efficiently use the q parameter (i.e. Accept: application/vnd.myapp+json;v=2;q=1.0,application/vnd.myapp+json;v=1;q=0.9), as ideally the server would select the most-preferred client version that it also supports, but that seems like a lot of overhead just to get strict correctness.
The video always cuts off at the last moment.
great! how soon do you think this could happen? we are currently thinking in doing it and I wonder if we should wait for your cast...
thanks a lot for all the great videos!
-cristobal
+1 That as well
Can anyone tell me how this kind of frameworks handle file uploads, since ajax upload is not standardized?
I enjoyed the introduction to Meteor.
I think Opa, http://www.opalang.org is another option to look at that is equally mind-blowing and perhaps more mature than Meteor.
Great video. I got a subscription just to see it.
One big question: How can I pass extraParams? I need to pass another id with the term and can't seem to get it to work.
pg_ctl start
before running your rake task.I have a problem when running my tests.
Everytime I try to
rake db:test:prepare
I getPG::Error: ERROR: type "hstore" does not exist
I'm not able to run my tests now :(
+1 for ExtJS 4.1
Do you have any recommendations for handling errors using the correct content type within an API namespace? For example if you 404 by POSTing to /api/products/1 instead of using a PUT, you get the Rails HTML 404 page in the response because the route does not match. Same goes for 500 errors if they ever happen.
Would be nice to get a JSON response for all requests in the namespace.
It's really up to you. But we handle the single master, multiple slave setup out of the box for both PostgreSQL and MySQL. All you need to do is add a machine with the appropriate slave role (e.g., postgresql_slave) and it'll auto-configure it for async streaming replication from your master. The config is all generated in your project though, so if you want to change to streaming replication, for instance, just modify the generated file and you're good to go.
Comment of the week!
I'm also having this error, but I think it has something to do with me running my server from port 3000:
http://forum.joomla.org/viewtopic.php?p=2317662
also
http://stackoverflow.com/questions/119336/ssl-error-rx-record-too-long-and-apache-ssl
No, Meteor is still in very early development. It's API changes frequently and also I believe the whole DB is exposed to the client. I'm not 100% sure about the last one though.
Was just looking for a solution while testing a portion of an application which uses google's geocoding service. We're limited to the number of geocoding requests we can make, so I turned to VCR.
I'd swear my reading comprehension is good until I attempt to read a README (no offense intended, Myron).
This screencast had me up and running moments after watching. Thanks much, Ryan and Myron!
Ryan, thanks so much for recording this episode. Last week I worked in something similar. Just one thing, I would pass the version as a mime type parameter. Something like:
curl -H "Accept: vnd.myapp+json; version=2"
Here's my implementation.
This worked for me as well, thanks! :)
Andy, take a look on this.
+1 to that!
+1
I would like to see that too
I'm keen to understad which of these rich application frameworks would be best suited for developing HTML5 mobile apps. How well do they work with offline storage and automatic synchronisation?
+1 for AngularJS
I love that you expose me to new technologies that I may never have checked out in my frenzy to get my work done. I'm a far more well rounded developer thanks to you.
I am hoping to cover authenticating/authorizing an API soon. Thanks for the suggestion.
Does anyone know a good technique for auto-generating API documentation?
Fixed, thanks for bringing this to my attention.