After watching this Railscast and researching a bunch of other articles online, I figured out a way to do it with all of the upsides and none of the downsides–you get a pretty URL with both ID and name, parameterized, fully functional in controllers/views, without having to add a slug field to the database or anywhere else. Pretty efficient, I think. This is it if anyone is interested:
Kind of a noob question here, but when Ryan moves the javascript into $(function() { }, why does this fix that issue? Would using the standard $(document).ready() not do the same thing?
Indeed
After watching this Railscast and researching a bunch of other articles online, I figured out a way to do it with all of the upsides and none of the downsides–you get a pretty URL with both ID and name, parameterized, fully functional in controllers/views, without having to add a slug field to the database or anywhere else. Pretty efficient, I think. This is it if anyone is interested:
https://gist.github.com/rceee/5021916
+1 to ember.js!
Outstanding overview of SASS. And thanks for the color wheel popup tip in TextMate; I didn't even know about that!
Great Railscast, though I felt Rails Composer was sorely missing; seems like it's becoming the de-facto solution for this kind of thing.
Is there a good way to prevent an user from adding (following) a friend more than once?
EDIT: This will do it:
This is an outstanding episode! So concise and helpful.
Just one question... One small JQuery-related thing through me for a loop.
in /app/assets/javascripts/subscriptions.js.coffee, why was the change made to:
$('#new_subscription')[0].submit()
?
What is the [0] for? I have not seen that before.
Kind of a noob question here, but when Ryan moves the javascript into $(function() { }, why does this fix that issue? Would using the standard $(document).ready() not do the same thing?
Kudos!
Thank you so much. Basics for some, perhaps, but I such a solid and great explanation, this was very helpful.
I also appreciate your using regular JavaScript/JQuery for the example, rather than CoffeeScript; the sleep() tip is nice as well :]
Kudos for this!