Please read for an updated status on RailsCasts:
Learn more or hide this
This user is a moderator.
GitHub User: KieranP
I implemented an activity feed last year which was a bit more complex than this. It had to store data such as specific actions like updating a models state column (from/to), as well as displaying consecutive activity grouped by the person who did it, and grouping the same consecutive action by the same person as "XX updated XXX (4 times)". Would be nice to see another pro episode that handled this display related stuff, since my code is kind of messy, and it's be cool to see how it might be implemented by someone else.
Wow. That's nice and clean. In this case though, it's a fairly simple example. Recently, I needed a hidden field with the id of the record, and a visible field with the name of the record (for a accepts_nested_attributes_for population). Custom JS and HTML I found was a bit more flexible.
I made a 'search' action on the Users controller, which implements the search and rendering of HTML, rather than JSON. I prefer this way because:
I've been using Vagrant since it's very beginning. Helped it's author test the early versions and contributed to it's underlining 'virtualbox' gem. A brilliant tool! Thanks for making making a screencast about it.
Personally I setup the environment and repackage it rather than using Chef (because Chef can take a while depending on your internet connection).
Also, you can create custom plugins to help you save time. Things like 'vagrant rails_server', which could load up the box, start up all background servers, and load the rails application server, all in one command. It will speed up development.
There is a special pro feed you need to subscribe to.
Go to http://railscasts.com/pro , click "Manage you subscription" and then click "RSS Feed" (follow the instructions there to add the feed to iTunes)
Instance variables in models are also lost because each request is basically a blank slate.
The only thing to persist through requests are class variables, however, they too get lost when the server is shut down (or in the case of Phusion Passenger, the worker goes idle and gets removed).
To overcome these issues, use an external caching system. Rails has support for a few, like memcached.
I see it's referred to inside the episode, so I've also added a link to the show notes. Thanks.
#249 deals with ActiveSupport Notification subscriptions, which this episode uses to catch exceptions.
#149 is relevant though, so I've added a link to it. Thanks.
Interesting. I wonder why Rails is able to load assets and initializers and such, but not able to pick up the migrations... one would think it could just append the migration path to the list of places to search for and run from.
That should be fixed now. Ryan pushed the fix for it, and seeing as those buttons for me are gone now, he must have deployed the fix too.
Lol, ironic that Guard can't reload it's own config.