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

  • SEARCH
  • Home
  • 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 8529241
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:59:14+00:00 2026-06-11T08:59:14+00:00

I get this when I visit a user’s profile page. so localhost:3000/users/1 for example…

  • 0

I get this when I visit a user’s profile page. so localhost:3000/users/1 for example…

I get it here in line 1

1: <%= form_for(@micropost) do |f| %>
2:   <%= render 'shared/error_messages', object: f.object %>
3:   <div class="field no-indent">
4:     <%= f.text_area :content, placeholder: "What's something else you want to buy?" %>

so then I have two micropost forms one is here

<%= form_for(@micropost, :html => { :id => "sale" }) do |f| %>
  <%= render 'shared/error_messages', object: f.object %>
  <div class="field no-indent">
    <%= f.text_area :content, placeholder: "What's something else you want to buy?" %>
    <%= hidden_field_tag 'micropost[kind]', "sale" %>
  </div>
  <%= f.submit "Post", class: "btn btn-large btn-primary" %>
<% end %>

and another one is here

<%= form_for(@micropost) do |f| %>
  <%= render 'shared/error_messages', object: f.object %>
  <div class="field no-indent">
    <%= f.text_area :content, placeholder: "What's something else you want to buy?" %>
    <%= hidden_field_tag 'micropost[kind]', "purchase" %>
  </div>
  <%= f.submit "Post", class: "btn btn-large btn-primary" %>
<% end %>

Here is my routes.

SampleApp::Application.routes.draw do
  resources :users do
    resources :comments
    member do
      get :following, :followers
    end
  end
  resources :sessions, only: [:new, :create, :destroy]
  resources :microposts, only: [:create, :destroy] do
    resources :comments
    resources :kind
  end
  resources :relationships, only: [:create, :destroy]

  root to: 'static_pages#home'

  match '/signup',  to: 'users#new'
  match '/signin',  to: 'sessions#new'
  match '/signout', to: 'sessions#destroy', via: :delete

  match '/help',    to: 'static_pages#help'
  match '/about',   to: 'static_pages#about'
  match '/contact', to: 'static_pages#contact'

and here is the code for the page itself (users show)

      <section>
        <%= render 'shared/user_info' %>
      </section>

      <section>
        <div id= "purchases">
          <%= render 'shared/micropost_form_purchase' %>
        </div>
        <div id="sales">
          <%= render 'shared/micropost_form_sale' %>
        </div>
      </section>


<% 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>Purchases I am interested in (<%= @user.microposts.count %>)</h3>
      <ol class="microposts">
        <%= render @microposts %>
      </ol>
      <%= will_paginate @microposts %>
    <% end %>
  </div>
</div>

also I dont understand how you can pass an empty object into form for? Isn’t the whole point of the form to create the object?

  • 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-11T08:59:15+00:00Added an answer on June 11, 2026 at 8:59 am

    According to the article which I stumbled upon today it may be that the object you are passing to form_for (@micropost in this case) is nil or empty.

    Here’s the mentioned article: http://schneems.com/post/31460949407/raise-hell-better-programming-through-error-messages

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

For reference, please visit this page here . When trying to get a view
I get a this eror when visit the url http://localhost:3000/admin/login : ActionController::RoutingError in Admin/login#index
Let's take a simple "Account Registration" example, here is the flow: User visit the
So anytime someone visits this page: http://www.site.com/page/image_(.*).png They get redirected to the cdn url,
I get this problem when I visit my domain.com. I have compared this with
<compilation debug=false targetFramework=4.0> I get this error while that line is red: Parser Error
I have 2 models: User and Interest. To get a specific users interest, you
I get this error while accessing a php script: W/System.err: Error reading from ./org/apache/harmony/awt/www/content/text/html.class
I get this error when i try to upload an image: OSError at /upload/
I get this error on my Ice Cream Sandwich (Android 4.0) device and emulator.

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.