Hey community,
It's my first day with ruby and rails. I figured the best way to learn this framework and language is to go ahead and create my idea using this framework. I think this is the best way for me to learn. I'm noticing at the end of my page, rails is printing the below to the screen before my pagination links. Any ideas why this is happening?
#<Post:0x10420f788>#<Post:0x10420f260>#<Post:0x10420ec20>
3 Replies - 2268 Views - Last Post: 18 April 2012 - 12:50 PM
#1
First day with ruby and rails... rails appending some weird text
Posted 18 April 2012 - 10:52 AM
Replies To: First day with ruby and rails... rails appending some weird text
#2
Re: First day with ruby and rails... rails appending some weird text
Posted 18 April 2012 - 10:54 AM
That looks like the result of printing an object without getting a string representation - I'm not too familiar with rails but I'd look around for places that unintentionally output Post objects, or that should be outputting an attribute of them rather than the whole thing.
#3
Re: First day with ruby and rails... rails appending some weird text
Posted 18 April 2012 - 12:20 PM
My guess is you used <%= some place where you intended to use <% (and the block inside the <%= %> then returns a Post object which is unintentionally written to the page). For more information you'd have to show us the code of the view that produces that output.
#4
Re: First day with ruby and rails... rails appending some weird text
Posted 18 April 2012 - 12:50 PM
sepp2k, on 18 April 2012 - 11:20 AM, said:
My guess is you used <%= some place where you intended to use <% (and the block inside the <%= %> then returns a Post object which is unintentionally written to the page). For more information you'd have to show us the code of the view that produces that output.
You were ABSOLUTELY correct! It was starting to drive me nuts! I had a <%= @p.each do |x| %> which was causing the problems. Thanks so much!
Page 1 of 1
|
|

New Topic/Question
Reply



MultiQuote





|