Ruby on Rails Tutorial Part 2 - CRUD Basics with the Rails Console

preview_player
Показать описание
In this Ruby on Rails Tutorial we'll learn the basics of how to do CRUD with rails inside of the rails console. In this video I'm using Rails 3.1 and Ruby 1.9.2 on Linux.

Рекомендации по теме
Комментарии
Автор

Thanks for this tutorials. Watched so many videos as ror greenhorn, but no tutorial explained the essentials as good as yours.

DennyMueller
Автор

For those running on rails 4! The line of code that is written on 4:35 "attr_accessible :title, :content" does not work on rails 4. Instead, you have to move on to the controller and write the following:
class PostsController < ApplicationController
def new
@p= Post.new(post_params)
end

private

def post_params
params.require(:post).permit(:title, :content)
end
end

Hope it helps!

victorls
Автор

Hi Matt, we just use the name of the Model and in Rails the models class name has the first letter capitalized.

Yes, you reference all models the same way by calling the model's name and using dot (.) notation to access its methods and properties.

andrewperk
Автор

hello andrew perk, u know i was intrested in ror, and i was looking for a start, because from last two or months i was looking for tutorials and trainings, i was listing to some screen costs, but i was confused that whats going on, i wasn't clear that what is rails and what r they doing, and now at the end i found u on youtube, great lecture, i m pleased to found ur lectures, thanks a lot,

imrankhanvu
Автор

best RoR tutorial series on youtube i've come across. thanks :)

alsouno
Автор

For people who are using Rail 4, you need to install gem install protected_attributes or save gem 'protected_attributes' in the GEMFILE

hellohello
Автор

Great videos! so much better than reading through documentation on my own !!! thank you!

annabortsova
Автор

Hi Scott, I never expected my videos to be as popular as they are and I just wanted to make some videos as I enjoy teaching. At the time I only had a cheap microphone and this is the quality that it gave me. Hopefully you'll still be able to learn even with the bad audio. Thanks for watching.

andrewperk
Автор

You have no idea, how helpfull you are to me!!!

minkury
Автор

@gamers542 Hello, yes it will work on windows. I used to do Rails on windows before moving to Linux. You should still be able to use almost the exact same commands. In your command line navigate into your rails app and run rails console or rails c as instructed. The reason I switched from Windows to Linux is because windows is terribly slow with Rails and testing. In Linux it's very fast. Things for rails just work in Linux where as in Windows it was always a struggle and Googlefu was needed.

andrewperk
Автор

I'm coming from JavaScript to Ruby. This language is beautiful

msnazi
Автор

I love these tuts! They have helped me a ton.

wilprim
Автор

I had to use the syntax: post = Posts.new(....
i.e. plural Posts
otherwise an error results...
Like the videos! Starts out nice & simple...

rixterman
Автор

Thanks ....this was helpful too!! I had a issue with the attr_accessible since i was running Ruby 4. However i could figure it out through googling. :)

SUNILRAHEJA
Автор

I programmed rails a few years ago.  Never knew you could update or delete by command line.  That's good to know. 
Rails 4 changed so much that I have to rewrite my programs to use them :(

inhibited
Автор

Great video...very easy to understand.

sjalal
Автор

you are amazing man! this will help me very mutch, tank you!

leandro
Автор

No worries. It's just so hard to focus. I skipped this one. The others are better. Thanks for posting. It's really helpful.

sthardman
Автор

I did find it useful. Very clear. Thanks! :D

NjeriChelimo
Автор

@andrewperk Thanks for your great help! It is very easy to follow and understand your tutorials. I have a question and I was wondering if you could help me with that. When i try -create Post table, it always says "nil" never goes to comment "Our first post" etc

What am I doing wrong?

Thanks beforehand for your help!

orujgadimov