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 729507
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:48:17+00:00 2026-05-14T06:48:17+00:00

I have built a very simple blog application using Ruby on Rails. New to

  • 0

I have built a very simple blog application using Ruby on Rails. New to both Ruby and Rails so excuse the stupid questions.

I currently have two tables that relate to this question. I have a Post table and a Tag table. Basically I set it up such that Post has_many :tags and Tag belongs_to :post. I am using AJAX to process and display the tags in the show view of the post.

I installed the auto_complete plugin and I am getting an error when I enter the letters in the text_field_with_auto_complete for tag creation. My suspicion is this is because the form is a remote_form_for or something I am doing wrong in the routes.rb. Here is the error and code:

Error

Processing PostsController#show (for 127.0.0.1 at 2010-04-13 23:25:46) [GET]
  Parameters: {"tag"=>{"tag_name"=>"f"}, "id"=>"auto_complete_for_tag_tag_name"}
  Post Load (0.1ms)   SELECT * FROM "posts" WHERE ("posts"."id" = 0) 

ActiveRecord::RecordNotFound (Couldn't find Post with ID=auto_complete_for_tag_tag_name):
  app/controllers/posts_controller.rb:22:in `show'

Rendered rescues/_trace (26.0ms)
Rendered rescues/_request_and_response (0.2ms)
Rendering rescues/layout (not_found)

remote_form_for located in /views/posts/show.html.erb

<% remote_form_for [@post, Tag.new] do |f| %>
    <p>
        <%= f.label :tag_name, "Tag" %><br/>
        <%= text_field_with_auto_complete :tag, :tag_name, {}, {:method => :get} %>
    </p>
    <p><%= f.submit "Add Comment" %></p>
<% end %>

tags_controller.rb (I’ll spare you all the actions but added the following here)

auto_complete_for :tag, :tag_name

routes.rb

  map.resources :posts, :has_many => :comments
  map.resources :posts, :has_many => :tags
  map.resources :tags, :collection => {:auto_complete_for_tag_tag_name => :get }
  • 1 1 Answer
  • 1 View
  • 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-05-14T06:48:17+00:00Added an answer on May 14, 2026 at 6:48 am
    ActiveRecord::RecordNotFound (Couldn't find Post with ID=auto_complete_for_tag_tag_name):
      app/controllers/posts_controller.rb:22:in `show'
    

    This shows that rails searching “auto_complete_for_tag_tag_name” method in posts controller so either modify routes.rb

    map.resources :posts, :collection => {:auto_complete_for_tag_tag_name => :get }
    

    OR

    Change remote form so that it should call method   
    "/tags/auto_complete_for_tag_tag_name"
        instead of  
    "/posts/auto_complete_for_tag_tag_name"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have built a variety of little scripts using Ruby's very simple Queue class,
I have a very simple chat system I've built using PHP and MySQL (this
I have built a very simple CakePHP website using the Auth component and have
I have built a very simple internal messaging system inside my application, i want
I'm working with a website built in .net, I have a very simple popup
I built a very simple app using a PHP form with a bit of
I have a very simple question. Is there a built in method to shorten
I am new to SoapUI and have just configured a very simple MockService. Is
I have a very simple holding page I built centering a div, anchor and
I have built a simple Android application to solve an annoying problem. Whenever you

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.