Thanks for this tutorials. Watched so many videos as ror greenhorn, but no tutorial explained the essentials as good as yours.
@victorls10 жыл бұрын
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 Solution found here: stackoverflow.com/questions/18409783/cant-mass-assign-protected-attributes-in-rails-4 Hope it helps!
@rgbm2110 жыл бұрын
You are right.I was stuck in it for a while..Thanks
@MrBrianHare9 жыл бұрын
Thank you
@eklektisk22319 жыл бұрын
Thank you! :D
@keithchong69609 жыл бұрын
+Víctor Lopez THANK YOU SO MUCH DUDE I LOVE U
@andrewperk12 жыл бұрын
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.
@alsouno12 жыл бұрын
best RoR tutorial series on youtube i've come across. thanks :)
@hellohello22310 жыл бұрын
For people who are using Rail 4, you need to install gem install protected_attributes or save gem 'protected_attributes' in the GEMFILE
@andrewperk11 жыл бұрын
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.
@imrankhanvu11 жыл бұрын
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,
@annabortsova13 жыл бұрын
Great videos! so much better than reading through documentation on my own !!! thank you!
@msnazi12 жыл бұрын
I'm coming from JavaScript to Ruby. This language is beautiful
@andrewperk13 жыл бұрын
@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.
@HVRain13 жыл бұрын
The best RoR tutorial, thank you
@minkury12 жыл бұрын
You have no idea, how helpfull you are to me!!!
@inhibited449 жыл бұрын
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 :(
@wilprim538311 жыл бұрын
I love these tuts! They have helped me a ton.
@rixterman0711 жыл бұрын
I had to use the syntax: post = Posts.new(.... i.e. plural Posts otherwise an error results... Like the videos! Starts out nice & simple...
@aaaabbbbccc12310 жыл бұрын
Note these videos are working in Rails 3.1 hence why post.new are throwing exceptions. See stack flow link for fix: stackoverflow.com/questions/17371334/how-is-attr-accessible-used-in-rails-4
@orujgadimov44208 жыл бұрын
@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!
@andrewperk13 жыл бұрын
@TheBrogrammer You're welcome.
@SUNILRAHEJA10 жыл бұрын
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. :)
@sthardman11 жыл бұрын
No worries. It's just so hard to focus. I skipped this one. The others are better. Thanks for posting. It's really helpful.
@sjalal022811 жыл бұрын
Great video...very easy to understand.
@leandro8429 жыл бұрын
you are amazing man! this will help me very mutch, tank you!
@NjeriChelimo12 жыл бұрын
I did find it useful. Very clear. Thanks! :D
@illtriniboy11 жыл бұрын
I just did this too, I guess we will see how this pans out
@stcheeve10 жыл бұрын
Great tutorial vids, straight to the point. The poping and audio skipping is extremely annoying though.
@oldno7uk11 жыл бұрын
patience of a saint!
@monarkbhagat84810 жыл бұрын
Hey Andrew.. I am very new to Ruby and ROR too, I just went as per ur video, I am using Rails 4; I added Post.new() to Post Controller and also did the post = Post.New[] in console when I tried to save it as per the video in console I wrote post.save its showing NoMethodError am stuck to this and hope to have a Quick reply on it..
@fxStar11 жыл бұрын
Hello, I'm getting NameError: undefined local variable or method `post' for main:Object when I try to do post.save ? Any ideas ? Thank your for these tutorials.
@gamers54213 жыл бұрын
But why do the post commands from the terminal instead of running a single file that has the commands stored? Is it easier that way or just for demonstration purposes?
@BlazeX3449 жыл бұрын
Very helpful tutorial, thanks! :)
@isnerdy11 жыл бұрын
Workaround for the runtime error: If you look at the error messages, it says that attr_accessible is depricated (AKA no longer used), and that there's a new security model for mass assignment. While probably not the best idea, one way around that is just to remove the attr_accessible line from the posts.rb file. I deleted the line and then didn't get any errors when setting up the hash.
@gamers54213 жыл бұрын
I'm learning RoR some more and your vids make it easy to follow. Question though. Can you do all that in a file and do Ruby (file name).rb on the command line (I'm using Windows) and it would still work? Thanks.
@shrenikdoshi26909 жыл бұрын
Hey your tutorials are very helpful to me But i have encountered one error please solve it asap NoMethodError: undefined method `attr_accessible` for Posts (call 'Post.connection' to establish a connection): Class
@imrankhanvu11 жыл бұрын
ok now about the problem, when i run this command post = Post.new(:title => "our first post", :content => "our post content") the console throws a bunch of errors, but the main error is like this, attr_accessible is extracted out of rails a gem. please use new recomonded protction model for params(strong_parameters) or add protected_attributes; to your gemfile to use old one. help me please.
@ShivaprakashYaragal8 жыл бұрын
@4.40: its attr_accessor
@deltaupsilonfraternity398211 жыл бұрын
Hello, I am learning RoR and I am having issues with this tutorial, and the blog in general. 1st after I activate the server for the localhost I cannot use the command prompt. (I am using windows) Also I get a runtime error when I try to set up the post = Post.new variable. Help?
@AverageGottn11 жыл бұрын
How do I add a column to table with that console?
@sampathchetelli880310 жыл бұрын
while storing values to post it only storing default values...............please resolve my problem...................
@imrankhanvu11 жыл бұрын
and some suggestions if u don't mind, when u write and command, its hard to read, because the font is too small, so is it possible that u edit all these lectures and u show all the commands in a subtitle in big size. that way it will be easy for use to read them. thanks a lot.
@bjornsteneram654011 жыл бұрын
So.. can't seem to find the source code for this video on your site Andrew! Good video tho!
@gadamson1211 жыл бұрын
When i do post = Post.new[:title => "Our First Post", :content => "Content for our first post"] it returns nil. Help?
@under_score226811 жыл бұрын
Great video, thank you very much.
@curatedbasics11 жыл бұрын
1.9.3p194 :005 > post = Post.new|:title => "first post", :content => "content") SyntaxError: (irb):5: syntax error, unexpected tASSOC, expecting $end post = Post.new|:title => "first post", :content => "content") hi!! any ideas how to fix this syntax error?
@SouravKen11 жыл бұрын
Any luck with the fix. I am trying to learn RoR. While following this tutorial I got stuck on this line. For sure this is because I am using latest version on and clearly unlike Java it does not seem to have backward compatibility. I am googling but not no success yet :(
@ianjamiesonmusic11 жыл бұрын
Will definitely be switching from PHP.
@vytaslll210 жыл бұрын
Try Laravel first :)
@ranesh23710 жыл бұрын
what is mass assignment?
@allenlee911111 жыл бұрын
Appreciate for your job!
@rtrnzero11 жыл бұрын
Looks like adding attr_accessible to post.rb caused a run time error when trying to create post = Post.new
@biNuTheFirst11 жыл бұрын
thanks bro! veryyyy useful
@rameshswe12 жыл бұрын
It is super . i am running ROR in Wampserver + ROR installer
@drewh2211 жыл бұрын
Thank you!
@BharathRajendran-SRM11 жыл бұрын
wow.. i love this tutorial ..how to upload file ...can u explain file concept in 12 video
@millennia11 жыл бұрын
i think its fine.
@TheRoger0058 жыл бұрын
I was enjoying your tutorials until your link to "source code" goes directly to a ridiculous blank insurance advert.
@Soraskull12 жыл бұрын
I can testify to how slow it is cause it drives me crazy.
@mayankrajput21029 жыл бұрын
1. irb(main):001:0> on running rails c 2. NoMethodError: undefined method `save' for nil:NilClass on running the post = Post.new.......
@IAMPROJECT45RI9 жыл бұрын
2.2.0 :016 > Post.title NoMethodError: undefined method `title' for # Somebody can halp me?
@SANVELXRP12 жыл бұрын
like it
@nikhilfadnis80099 жыл бұрын
audio quality kinda sucks
@4sky11 жыл бұрын
migrate=> where migrations will be stored config=> where you store configurations for ruby stop using the word to describe the word! it doesnt clear up anything...
@JeffRAX5 жыл бұрын
it appears he is not describing the word, but explaining what is in those folders...