888.524.6150 | software@K3integrations.com
Posted by Gary Benton on Wednesday, June 13, 2012.
Would you like to learn how to create a simple application using Ruby on Rails? Ruby on Rails is becoming very popular because sites can be developed quickly, often in half the time the other technologies require.
In the video below, you'll learn how to create a simple blog application with Ruby on Rails.
John Ash, Senior Developer at K3 Integrations, recently gave a Ruby on Rails presentation in Hong Kong. Here's the part he wasn't able to fit into the presentation:
Here's a question from a viewer on YouTube:
"When I log into a user, and click the logout button, it throws an error and I ca't seem to be able to fix it. Maybe you can give me some insight?
ActiveRecord::RecordNotFound at /users/sign_out
Couldn't find User with id=sign_out
The answer was too long to fit into the reply on the YouTube page, so I'm posting it here:
There's one of two things going on. Either:
Now, if you disable JS or don't have the data-method attribute on your logout link, the request to /users/sign_out will go to Rails as a GET request. If you type "rake routes" you will see that there is a DELETE route to /users/sign_out and a GET route to: /users/:id The second route here is what allows us to view details of users by specifying their id in the url, such as: /users/6 for showing the user with the id of 6. If the request to Rails comes in as a GET, then Rails will skip the DELETE route and instead use the GET route, and will attempt to find a user with the ID of "sign_out", which of course fails.
Hope that helps. --John
Here's another question from a viewer:
I'm sorry if the question is too obvious, but when I try to run the rails command I'm getting this : invalid option -T. Can anyone help me out?
Reply from John Ash:
I'm not exactly sure why you're getting an error for -T I tried out my tutorial instructions and the -T worked fine, but I found that the original rails template has been removed. The first command to run has now changed to:rails new gain_blog -m https://raw.github.com/RailsApps/rails-composer/master/composer.rb -T Then choose option #4. Ooh. Many of the questions have changed, but it should get you more or less the same app. Let me know if other things break.