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!
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
ruby gupta
1,200 Pointsfull_name Not Showing on Profile Page
every thing is working bt user name is not showing in my profile page.
This is my show.html.erb file.
<div class="page-header">
<h1> <%= @user.full_name %> </h1>
</div>
<% if @statuses %>
<% @statuses.each do |status| %>
<div class="well">
<%= status.context %>
<hr/>
<%= link_to time_ago_in_words(status.created_at), status_path(status) %> ago
</div>
<% end %>
<% end %>
Greatly appreciate any help. Thank you!
1 Answer

Joel Smith
14,779 PointsTry using the "yield" function before @user.full_name .. I'm stabbing in the dark here, but it worked with a project I'm working on in a similar manner.
ruby gupta
1,200 Pointsruby gupta
1,200 PointsNo, this code is not helping me :(
<%= yield @user.full_name %>
Joel Smith
14,779 PointsJoel Smith
14,779 PointsIt's likely that you haven't fully defined what @user.full_name is yet. Can you post all of the code for Me and I'll try to help you the best I can
ruby gupta
1,200 Pointsruby gupta
1,200 Pointswhen i try the code without @ symbol it's give me error
undefined local variable or method `user' for #<#<Class:0x51d1b20>:0x51d06c8>
Joel Smith
14,779 PointsJoel Smith
14,779 PointsGo ahead and post all of your code and I'm sure I can figure out what's going on.
ruby gupta
1,200 Pointsruby gupta
1,200 PointsMy profile_controller_test.rb look like this
require 'test_helper'
class ProfilesControllerTest < ActionController::TestCase
test "should get show" do
get :show, id: users(:sarah).profile_name
Joel Smith
14,779 PointsJoel Smith
14,779 PointsAre you using Rspec or MiniTest suite?
ruby gupta
1,200 Pointsruby gupta
1,200 PointsNo...... I' m following the video of teamtreehouse.