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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T23:47:45+00:00 2026-05-30T23:47:45+00:00

I have a search input box for them to insert ‘tags’, and it autocompletes

  • 0

I have a search input box for them to insert ‘tags’, and it autocompletes the box. This is going to be an ajax request to Tag.all.

Unfortunately, i have resource :tags in my routes, and i’m using ALL the rest actions for other things in tags_controller.rb (:index, :get, :new, :create, :update, :destroy, etc).

Would I make an entirely new controller or how would i go about doing this. Or should I add something else to the tags_controller just for ajax. I know how to do it many other ways I just want to follow the best rails conventions.

Also how do I go about adding it so it returns json in the appropriate ‘rails way’?

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-05-30T23:47:47+00:00Added an answer on May 30, 2026 at 11:47 pm

    Rails normally would dictate that you use the index action (as you are requesting all the resourceS) with a respond_to block, and respond differently based on whether the call is asking for html or JSON. Here’s a link to the Rails guides that explains it in a bit more depth.

    http://guides.rubyonrails.org/action_controller_overview.html#rendering-xml-and-json-data

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

Sidebar

Related Questions

I have a simple form like this: <form name=serachForm method=post action=/home/search> <input type=text name=searchText
I have a search input box that appears upon rollover of a button. Rather
I have an input text box for search of input, the id of the
id like to have an input box that a user can enter a search
I have this code: <form method=get action= id=search> <input id=search_box name=search type=text class='search_box' onkeypress=if(event.keyCode==13)
I have a simple search page with a single input box. I want to
I have an html select box and a search field (input type) When I
I want to have a search input box like iTunes has. I have my
Many pages have a search box to them which will typically have the overlayed
I have a search box at the top of page that makes an ajax

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.