Activity
Posted in jQuery UJS Callbacks Discussion
Hey Vlad and biodiscover, that's totally fair. There are people who have asked to pay and want to support the site. I understand you're not sold yet and there's nothing wrong with that. Everyone's at a different stage in their career, so some people have gotten some valuable insights out of the screencasts so far and other people are further along that they haven't. I'm working my way towards the more advanced content. Hopefully over time I'll be able to earn your support as well! :)
It seems to be a bug in the new readline dependency. I *think* if you're on the latest patch version of 2.0.0 (p481) that it has a patch for that bug.
Ah I see now. So the stripe button JS takes an amount simply to display the amount. On the backend, you are always submitting charge for the same amount which is why you're seeing that problem.
To solve this, you want to define some "plans" and submit that to the create action along with the stripe card token. You can do that in hidden fields, but you want to do that instead of submitting the amount so users can't submit their own amount which would be a security issue. If you send over the plan name and look up the amount (you can hardcode this into your app), then you can calculate the appropriate price. Does that make more sense?
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?
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?
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.
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.
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.
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.
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..."}