Chris Oliver

Joined

292,890 Experience
93 Lessons Completed
295 Questions Solved

Activity

The easiest way is actually to use a JS response that sends back the calendar partial and you can just simply replace that part of the page. I made this a while back to show how that's done: https://github.com/excid3/s...

Let me know if that makes sense and accomplish what you're trying to do!

Posted in Refactoring Controller Methods Discussion

QUESTIONS is a list of all the questions to ask in the various states of the application. When you move to the next state, you can easily lookup the question from the QUESTIONS hash that you need to send out. What happens is that when the user sends a response with their first name, the @reply model gets it's state attribute changed over to "last_nm" and then it knows to ask for the last name. Each time a response is saved, it updates the state to the next one. I made a couple episodes on state machines and the state machine that can help you wrap your head around this part:

https://gorails.com/episode...
https://gorails.com/episode...

Posted in Scheduling Posts Discussion

That's a great question Brian. I think that what I was experiencing was that the jQuery code I wrote never gets re-executed when the page changes via Turbolinks. Usually jquery-turbolinks fixes that by hijacking the page change event and that automatically fixes it. You might double check to make sure that jquery-turbolinks is being included in your application.js file properly. That's about the only thing that I can think of off the top of my head.

Sure! Send it my way!

Posted in Which native app technology to pair with Rails

I'm a huge fan of React and think it's been particularly well thought out. Facebook has spent an enormous amount of time engineering things and came up with a pretty novel approach. One of the clues (for me) that I should avoid Ember was how quickly they were rolling in features and ideas from everywhere else. React's server side rendering is wonderful but Ember chose not to address it for a long time until React came out. They just end up copying a lot of things and I'm afraid that's going to lead towards bloat more than a fantastic framework.

RubyMotion is also a great option. I don't know too much about it, but I believe that this is what Basecamp uses for their iOS mobile app. They have their custom JS framework that works with Turbolinks so I'm sure this made a lot of sense to them.

I think you're pretty solid either way you go. The React community is about a thousand times larger than Turbolinks + RubyMotion I feel like which means you might get a lot more support along the way. This is just a hugely biased opinion from me though, so take it with a grain of salt. ;)

Interesting. I'd love to cover that, although I have no idea what it takes to setup an ADFS server in order to try all this out. It does look like it's pretty tricky to accomplish.

Do you have any idea if it's easy to setup an ADFS server?

Posted in Speed up videos

Hey Chris!

As long as you're using HTML5 for the video streaming, you should see this underneath: http://cl.ly/d82h The paid videos are hosted on Wistia, so those controls show up for them. The free videos are hosted on Youtube, and you can click the gear in those videos to speed them up.

Posted in Deploy Multiple Rails Apps to Same DigitalOcean Droplet?

You got it! :) I appreciate that a lot. I've been trying to make sure it all stays up-to-date as much as possible.

Lemme know if you hit any snags!

Posted in Deploy Multiple Rails Apps to Same DigitalOcean Droplet?

You'll love this, it's almost too simple.

For your new app, you can basically copy the Capistrano configs from the old one and change the app name in all the places. You'll need to add another server block to your Nginx config, restart Nginx, and create a new database for this app. That's it. Just deploy like you did before, and create the database.yml file on the server to point to the new database and you're off to the races.

Changing the domain name in the nginx config and pointing a second domain to the same server is all you need to do in order to have Nginx serve up two sites from the same machine.

You can basically just follow those same steps from the guide, but skip the installation parts and go straight to the nginx config, database, and capistrano pieces.

Posted in Sending emails with Mandrill Discussion

Always glad to help! Let me know how it goes (and how lunch is). ;)

Posted in Sending emails with Mandrill Discussion

The Gibbon gem should let you do this. You can add someone to the list when they sign up. This is what I do with GoRails on registrations so that I can send the announcement emails out with Mailchimp. That *should* do the trick for you there.

Posted in What do you think about this ?

Great points! I'll get on this. :)

Hey Aaron!

It might make the most sense to have a post_type field that's video, blog, or poll. You could then dynamically add new types easily and have each of these render out different partials based upon the type. That's really the simplest way of doing it. You'll still query one model which keeps things all together, but the rendering will show the different types of content.

You can also take this a step further with what's called Single Table Inheritance or STI. You could create Blog, Video, and Poll models that inherit from Post and then you can organize your code out nicely inside these various models for the code that's specific to each type.

More reading for you on STI: http://eewang.github.io/blog/2013/03/12/how-and-when-to-use-single-table-inheritance-in-rails/

Yeah it was not a very good series. I didn't show the whole thing and just emphasized certain parts. Are you interested in seeing the whole thing? I might do a revised series on it or something similar.

Posted in Redirect To Current Page After Login | GoRails - GoRails

This doesn't make sense for a site that's globally locked down. That's why it's designed in the way that it is.

If you're locking down everything, the Devise before_action :authenticate_user! can take care of that for you. You can also put that in ApplicationController to have it apply to every single request.

Posted in Deploy Ubuntu 14.04 Trusty Tahr Discussion

Hey Alejandro,

2 things:

1. You accidentally pasted your password into this (I edited it out), but you'll want to go change that now.

2. It sounds like your SSH key is not added to Github. It's connected to the server and now needs to ask Github for your code so that it can put it on there. That step has failed and so you'll want to make sure that your ssh key is added to your user account on Github.

Posted in What do you think about this ?

Thanks for the kind words! :D

I've definitely been planning on adding that. Here's a question for you. Which makes more sense? Having it automatically marked as "played" like Youtube does or having a button for you to mark it as watched? My first impression would be is the automatic one seems like a better idea, but I'd love to hear your thoughts (and anyone else's) on this!

Also I need to get emoji support in the forum ;-)

I haven't done an episode on it, but for now, check out this tutorial. It should do the trick for you! http://sourcey.com/rails-4-...

Posted in Just sharing: Squash your migrations

That gem seems super interesting. Haven't seen it before. Thanks for sharing!

I almost always recommend making sure you use the same database in development as you use in production. That way you don't get unexpected results when deploying.