Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8340223
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T05:07:17+00:00 2026-06-09T05:07:17+00:00

I can’t figure out why my ‘shared/error_messages’ partial isn’t being rendered when it should

  • 0

I can’t figure out why my ‘shared/error_messages’ partial isn’t being rendered when it should be (i.e. when an invalid ‘treating’ is submitted through this form):

_treating_form.html.erb:

<%= form_for(@treating) do |f| %>  
    <%= render 'shared/error_messages', object: f.object %>
    <div><%= f.hidden_field :requestee_id %></div>  
    <div>
        <%= f.text_field :proposed_location, placeholder: "Propose a location here..." %>
    </div>    
    <div>
        <%= f.text_field :proposed_date, placeholder: "Propose a date here..." %>
    </div>
    <div class="field">
        <%= f.text_area :intro, placeholder: "Write your introduction here..." %>
    </div>
    <%= f.submit "Send", class: "btn btn-large btn-primary" %>
<% end %>

This _treating_form.html.erb partial is called in a users/show.html.erb view:

<% provide(:title, @user.name) %>
<div class="row">
    <aside class="span4">
        <section>
            <h1>
                <%= @user.name %>
            </h1>
        </section>
        <% if signed_in? %>
            <section>
                    <%= render 'shared/treating_form' unless current_user?(@user) %>
            </section>
        <% end %>
    </aside>
</div>

Here is my error_messages partial:

<% if object.errors.any? %>
    <div id="error_explanation">
        <div class="alert alert-error">
            The form contains <%= pluralize(object.errors.count, "error") %>.
        </div>
        <ul>
            <% object.errors.full_messages.each do |msg| %>
                <li>* <%= msg %></li>
            <% end %>
        </ul>
    </div>
<% end %>

The error_messages partial is correctly being rendered upon validation errors triggered in submitting to user ‘edit settings’ page:

<% provide(:title, "Edit user") %>
<h1>Update your profile</h1>
<div class="row">
    <div class="span6 offset3">
    <%= form_for(@user) do |f| %>
        <%= render 'shared/error_messages', object: f.object %>
        <%= f.label :name %>
        <%= f.text_field :name %>
        <%= f.label :email %>
        <%= f.text_field :email %>
        <%= f.label :password %>
        <%= f.password_field :password %>
        <%= f.label :password_confirmation, "Confirm Password" %>
        <%= f.password_field :password_confirmation %>
        <%= f.submit "Save changes", class: "btn btn-large btn-primary" %>
        <% end %>       
    </div>
</div>

Any ideas why the errors aren’t being shown when an invalid ‘treating’ is being submitted? Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T05:07:18+00:00Added an answer on June 9, 2026 at 5:07 am

    Whenever you add ANY options to a partial you need to explicitly specify :partial =>

    = render partial: 'shared/error_messages', object: f.object
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can't figure out how to do this in a pretty way : I have
Can't seem to figure out what's wrong with the simple getJSON call below. It's
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
Can anybody help me? What should be the datatype for this type -07:00:00 of
Can't work out a way to make an array of buttons in android. This
Can anyone help me trying to find out why this doesn't work. The brushes
can you recommend some good ASP.NET tutorials or a good book? Should I jump
Can anyone tell which Javascript framework is being used for http://iphone.paulmillersubaru.com/index.htm#index_p_2Ehtm Is this based
Can anyone let me know how can we change the value of kendo combobox
Can I order my users in the database, so I don't have to say

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.