Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
chris salvi
7,584 PointsHelp again on Ruby on Rails project :(
Preface by saying I am running the most up to date version of rails and ruby so this may be the cause of the error, but I would hope someone could help me correct it.
The error is saying I dont have full_name method defined, even though my screenshot will show otherwise. I will attach a bunch of screens for reference, and I am stumped what I did wrong.
Maciej Czuchnowski
36,441 Pointschris salvi test tagging
Maciej Czuchnowski
36,441 PointsOK, just start typing the @ symbol and then my name and a dropdown should appear, select me and that part will become a link when you post the question/comment. I will probably get notified if tagged.
3 Answers
Maciej Czuchnowski
36,441 PointsSeems like Strong Parameters problem. When you create a new user through the page form and go to Rails Console, does that user have the first name and last name, or are they nil?
chris salvi
7,584 PointsHi Maciej,
Thank you for all your help this past week. I will check and get back to you. Im not sure why these strong parameters would be an issue since I've followed the video to a T, but then again Im running a much newer version of ruby and rails and havent checked about all the depreciated syntax.
Maciej Czuchnowski
36,441 PointsThe videos use Rails 3. Rails 4 introduces Strong Parameters by default, so it's a very common problem with this course.
chris salvi
7,584 Pointsugh, I respect the output of videos on this site, but they could really use some better documentation on the lessons if things are outdated for newer versions. Just write up a few paragraphs in the teachers notes.
Also, keep posted. I wont be able to run my program until later, so I will see what's up then
Maciej Czuchnowski
36,441 PointsHere's one suggested workaround, first try Tanner's method, then you can scroll down to see my solution, both should work:
chris salvi
7,584 PointsMaciej, do you mind taking a look at the project from my github account? I am still receiving an error when I press the create status button despite following the rails 4.0 tutorial.
Maciej Czuchnowski
36,441 PointsSure, I'll take a look and let you know.
chris salvi
7,584 Pointsthank you so much. It's a community with people like you that make this site worth it.
Maciej Czuchnowski
36,441 PointsI can't find anything wrong...the application runs smoothly. I can register, publish posts and everything shows up. No errors when registering or posting.
What I can suggest, maybe it will work:
Create a new folder, download your app from github (either clone or download a zip), run bundle install`` just in case, runrake db:migrate, runrails s``` and go to localhost 3000. See if the problem persists. The copy from your github works perfectly on my Linux and J Scott Erickson's machine. We will try to investigate further if this doesn't work. Sorry for the delay.
chris salvi
7,584 Pointsthanks maciej, I had a friend debug it for me over the weekend, and Im still a tad unsure of the changes he made, but the code up on github is now error free, although I need to clean up the styling a tad since Im using a different version of bootstrap. Hopefully I can rely upon you in the future if I need help. Is there a way to tag users on here for questions?
Maciej Czuchnowski
36,441 PointsSure you can :). I have no idea if tagging is possible. Just post your question, I will see it sooner or later ;)
Ryan Duchene
Courses Plus Student 46,022 PointsTry this. I think it'll work, but I'm not 100:
# inside the User class
def full_name
self.first_name + " " + self.last_name
end
chris salvi
7,584 Pointsso self looks up to the User class/object? Sort of like how this does in javascript? I dont really see the necessity for this, but then again Im just getting used to the language. I will try your suggestion in a bit and confirm if it works.
Ryan Duchene
Courses Plus Student 46,022 PointsExactly! All object-oriented languages have that construct or something similar. Everything from JavaScript to PHP to Objective-C to Java.
chris salvi
7,584 Pointsunfortunately that did not work Ryan, but there must be something wrong with how it's reading the index.html.erb file because when I delete .full_name everything works again.
also now getting this error when I click on 'post a new status'
J Scott Erickson
11,883 PointsThis issue must be fixed? I cloned your project from github and couldn't find an issue ( other than in your statuses controller the strong params were on the same line as the method definitions ), but it works for me otherwise.
chris salvi
7,584 PointsJ Scott, as of now I get an error when I
- click on the create status button
- click on register
chris salvi
7,584 Pointschris salvi
7,584 PointsError: http://postimg.org/image/iighufo9t/
Method: http://postimg.org/image/uuj5sawwp/
Code1: http://postimg.org/image/gv8wpuswt/
Code2: http://postimg.org/image/iq3wbbk0p/
Code 3: http://postimg.org/image/suqz98wc1/