Monday, 15 February 2010

railstutorial.org - Michael Hartl RailsTutorial Chapter 10.2.2 Sample Microposts -



railstutorial.org - Michael Hartl RailsTutorial Chapter 10.2.2 Sample Microposts -

i completing michael hartl's rails tutorial chapter 10.2.2 sample microposts

visit http://ruby.railstutorial.org/chapters/user-microposts?version=3.2#sec-creating_microposts

i running issue profile page css not render properly. rspec passes, page loads, , can navigate entire site without issue. css code called out class links css code rails output. paste much info can think of. note: absolute beginner rails programming or object oriented please specific in responses may not yet have experience comprehend subject.

i post pictures not posses required reputation points yet.

here code though...

this html profile page not render properly

<% provide(:title, @user.name) %> <div class="row"> <aside class="span4"> <section> <h1> <%= gravatar_for @user %> <%= @user.name %> </h1> </section> </aside> <div class="span8"> <% if @user.microposts.any? %> <h3>microposts (<%= @user.microposts.count %>)</h3> <ol class="microposts"> <%= render @microposts %> </ol> <%= will_paginate @microposts %> <% end %> </div> </div>

this css code page

/* microposts */ .microposts { list-style: none; margin: 10px 0 0 0; li { padding: 10px 0; border-top: 1px solid #e8e8e8; } } .content { display: block; } .timestamp { color: $graylight; } .gravatar { float: left; margin-right: 10px; } aside { textarea { height: 100px; margin-bottom: 5px; } }

also, home page calls upon css code render microposts if user signed in. page not rendering microposts properly. home page html below

<% if signed_in? %> <div class="row"> <aside class="span4"> <section> <%= render 'shared/user_info' %> </section> <section> <%= render 'shared/micropost_form' %> </section> </aside> <div class="span8"> <h3>micropost feed</h3> <%= render 'shared/feed' %> </div> </div> <% else %> <div class="center hero-unit"> <h1>welcome sample app</h1> <h2> home page <a href="http://railstutorial.org/">ruby on rails tutorial</a> sample application <br>sample app tutorial completed jake danforth. </h2> <%= link_to "sign now... because it's awesome!!!", signup_path, class: "btn btn-large btn-primary" %> </div> <%= link_to image_tag("rails.png", alt: "rails"), 'http://rubyonrails.org/' %> <% end %>

the lastly code calls upon _user_info.html.erb file code included below

<a href="<%= user_path(current_user) %>"> <%= gravatar_for current_user, size: 52 %> </a> <h1> <%= current_user.name %> </h1> <span> <%= link_to "view profile", current_user %> </span> <span> <%= pluralize(current_user.microposts.count, "micropost") %> </span>

as continually troubleshoot issue, update can find out. issue <%= render @microposts %> calls @microposts variable (right?). defined in file users_controller.rb

def show '@user = user.find(params[:id]) '@microposts = @user.microposts.paginate(page: params[:page]) end

which not lead css file far can tell. somehow needs phone call on .microposts class in css file render.

i have discovered error in css code. rearranged css code clean more , found bracket. don't know why code still rendering pages without faulting, however, when removed bracket began render screen intended. leaving file on-line in case else trying tutorial , runs issues brackets. create sure open , close brackets equal!

railstutorial.org

No comments:

Post a Comment