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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T10:09:29+00:00 2026-06-07T10:09:29+00:00

I have this search controller url: http://localhost:3000/search/index?utf8=✓&search=Search_terms how can trim this to: http://localhost:3000/search=query the

  • 0

I have this search controller url:

http://localhost:3000/search/index?utf8=✓&search=Search_terms

how can trim this to:

http://localhost:3000/search=query

the search code:

#search-box
  #search-form
    = form_tag search_index_path, :method => 'get'  do
      = text_field_tag :search, params[:search], :autocomplete => "off"
      %button#search-button{:type => "submit"}
        %span Go!

Or is that possible??

Please advise.

  • 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-07T10:09:30+00:00Added an answer on June 7, 2026 at 10:09 am

    This is not possible by Ruby (or Rails) itself. You need to

    1. append a JavaScript callback to the submit event of the form
    2. validate the form
    3. replace the target URL of the form with the one composed by search= + input value.

    Keep in mind that not all characters can be part of an URL. This is the reason why you should pass the search query as parameter, not as part of the URI.

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

Sidebar

Related Questions

I have this query where I can search the TABLE_GLOBAL_PRODUCTS $catglobal_sql = select p.*,
I currently have this as a search: <%= form_tag users_path, :controller => 'users', :action
I have a search display controller in a table view. In this table view,
I have this sql query: SELECT S.SEARCH, S.STATUS, C.TITLE AS CategoryName, E.SEARCH_ENGINES AS Engine,
i'm using autocomplete from jquery... and i have this: $('#name_search').autocomplete({ source: search/name.php, open: function(){
I have this configuration: A page containing a search field, at the submit in
i have this code from a tutorial: // Do the search and show the
i have this MySQL statement from a search page, the user enters there postcode
i have this code to get the search resutls from the api: querygoogle.php: <?php
I have code like this: function search_keyword(){ $keyword = $this->db->escape_like_str(trim($_POST['keyword'])); $sql = ( SELECT

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.