ruby on rails 3 - ActionView::MissingTemplate in Users#comments -


i'm getting missing partial error in rails app, though created partial file! i'm little stumped. here error i'm seeing:

actionview::missingtemplate in users#comments missing partial comments/comment {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :coffee]}. searched in:   * "/home/bruce/rails_projects/appname/app/views"   * "/home/bruce/.rvm/gems/ruby-2.0.0-p0/gems/devise-2.2.4/app/views"  app/views/users/show_comment.html.erb:24:in `_app_views_users_show_comment_html_erb___2848231870651058222_30950520' app/controllers/users_controller.rb:59:in `comments' 

here's view calls partial:

                <% if @user.comments.any? %>                  <h3><%= render @comments %></h3>                  </ol> 

here's relevant code users controller:

def comments     @user = user.find(params[:id])     @comments = @user.comments.all     render 'show_comment'   end 

i named partial show_comment.html.erb, correct file name. i'm doing similar different page called show_post , works fine. i'm comparing code between 2 , seem identical. what's different here? did wrong? need set of eyes review me.

thanks!! -b

the error telling rails looking partial named _comment.html.erb in comments folder because default partial name/location array of comments. add file , partial code there. like:

<li><%= comment.value %></li> 

you won't need h3 tags around partial call in show comments view.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -