Chris Oliver

Joined

290,710 Experience
86 Lessons Completed
298 Questions Solved

Activity

Posted in Setup MacOS 10.9 Mavericks Discussion

That command is provided by ruby-build. Make sure you didn't miss any of those steps.

That's generally not something you would want to do unless you are talking about AJAX. What are you trying to accomplish?

Posted in Setup Ubuntu 14.04 Trusty Tahr Discussion

Thanks John. That *should* be fixed in Ruby 2.1.2. Is that what you were installing?

Posted in Pretty urls with FriendlyID Discussion

It works fine in Rails 4. From what I can tell, those find_by_COLUMN methods didn't go away, but the ones listed in the README here did: https://github.com/rails/ac...

Posted in Setup MacOS 10.9 Mavericks Discussion

Sounds like you don't have postgres running. Follow the steps in the postgres section again to make sure you got them (especially the launchctl one.)

Posted in Setup MacOS 10.9 Mavericks Discussion

Change your config/database.yml to look like this:

development:
adapter: postgresql
host: 127.0.0.1
database: myapp_dev
username: YOUR_POSTGRES_USER

Rename the database to whatever you want to call your app's database and also make sure to change your postgres username to your username. And last, but not least, make sure postgres is running.

Posted in Setup MacOS 10.9 Mavericks Discussion

Try specifying the "host: 127.0.0.1" option so it doesn't try to connect through the socket.

Posted in jQuery UJS and AJAX Discussion

If you create a partial to render the list of articles, you can do that easily with this. If you have a div that contains all the articles:

<div id="articles"></div>

You can create a link to load them:

<%= link_to "Load Articles", articles_path, remote: true %>

And then your articles.js.erb can insert them into the page:

$("#articles").append("<%= escape_javascript(render partial: "articles") %>");

That would render the _articles.html.erb partial, insert it into the JS response, and then when it gets executed, it will add it to the end of the #articles div.

Make sense?

Posted in Using Vagrant for Rails Development Discussion

Most definitely!

Posted in jQuery UJS and AJAX Discussion

Good point. That works well enough. I'm curious, do you know of any ways to actually have it throw Javascript exceptions to make debugging even easier?

I guess it does trigger the "ajax:error" callback with the error, so we could listen for that. Looks like this gives a few decent examples: http://blog.bigbinary.com/2...

Posted in jQuery UJS and AJAX Discussion

Thanks David! I think learning how Rails works itself is the key that most people aren't teaching. Hopefully this approach helps a lot.

Posted in Deploy Ubuntu 14.04 Trusty Tahr Discussion

Get rid of the keys line in ssh_options. You have to login to the server with your local ssh key, not your remote user's key. It will do this by default and same with auth_methods. You can leave forward_agent but can get rid of the rest.

Posted in Deploy Ubuntu 14.04 Trusty Tahr Discussion

Ah okay, then check that your config matches your ssh credentials. You've got something different in your config than what you use when connecting over ssh manually.

Posted in Deploy Ubuntu 14.04 Trusty Tahr Discussion

user@ip_address

It looks like you didn't change user or ip_address to the actual user account or IP number. Change that and it should work.

Posted in Deploy Ubuntu 14.04 Trusty Tahr Discussion

Thanks Ben, definitely plan on doing that. Chef scripts are super duper awesome and it's incredibly useful. Hopefully I'll be able to do that soon!

Posted in Styling with Bootstrap Sass Discussion

Just make sure sass-rails is in your Gemfile. As long as you're on a compatible version of sass, you should be fine.

You might just be missing the ending curly brace. This works for me:

= button_to "Go Rails!".html_safe, events_path, method: :patch, class: 'btn btn-success', data: { disable_with: " Waiting..."}

Posted in Debugging With BetterErrors Discussion

Pry is awesome as well. This is similar and doesn't need to be in your console. It's not as powerful as pry in some areas like being able to cd into objects, so you can use the two together.

Posted in Keeping track with Annotate Discussion

Thanks for sharing that! I don't think I've run annotate with Postgres specific data types so I didn't know it had trouble with that. Great job on the gem.

Posted in Ruby Version Managers Discussion

With these version managers, you should never need to use sudo. The reason for this is that they install Ruby in your home directory so you own it. That means that installing gems, running bundler, and anything else all happens in your home directory as well. Since you own that folder, you won't be installing somewhere in the system and means that using sudo then would change the ownership to root and cause problems.