The CSS styling for the jQuery UI autocomplete feature is not showing up as expected

Attempting to integrate jQuery UI's autocomplete feature, but encountering issues with the CSS not being applied.
1) College list appears unstyled like a standard ul.
2) Unwanted message "11 results are available, use up and down arrow keys to navigate" is displayed.

Check out my website for a live example.

Desiring functionality similar to the default setup shown here.

Followed instructions here for installing jQuery UI, and here for adding themes.

The code provided needs styling adjustments. How can I achieve the desired look resembling the default example?

application.html.erb

 <%= form_tag("/search", :method => 'get', :id => 'search_text', :class => 'form_search ui-autocomplete') do -%> 
    <div id="search"> <%= search_field_tag :search, params[:search], :placeholder => 'enter college', :id => "search_field", :class => 'input-medium search-query ui-autocomplete' %> </div>
<% end -%>

home.js

    $("#search_field").autocomplete({
      source: [
      "Adelphi University",
      "American University",
      "Andrews University",
      "Arizona State University",
      "Ashland University",
      "Auburn",
      "Wheaton - Illinois",
      "Wheaton - Massachusetts",
      "Whitman",
      "Wofford" ]
    });

$("#search_text").submit(function() {
        if ($("#search_field").val() == "Adelphi University")
        {
            window.location.href = "/adelphi-university";
            return false;
        }
        else if ($("#search_field").val() == "American University")
        {
            window.location.href = "/american-university";
            return false;
        }
        else if ($("#search_field").val() == "Andrews University")
        {
            window.location.href = "/andrews-university";
            return false;
        }
   });



UPDATE (not sure if relevant, but...)

college.rb

class College < ActiveRecord::Base
  attr_accessible :name, :url, ...

...

end

static_pages_controller.rb

def search
  @colleges = College.search(params[:search])
end

UPDATE - Did I Install jQuery UI Themes Properly?

  • Utilized this guide.
  • Upon running bundle install, following entries appeared:
    Using jquery-rails (2.2.1) 
    Using jquery-tablesorter (1.5.0) 
    Using jquery-ui-rails (4.0.4) 
    Using jquery-ui-themes (0.0.11)
  • application.css includes
    *= require jquery.ui.all
    *= require jquery-ui/smoothness
    *= require_self
    *= require_tree .
  • Confusion noted regarding "Helper" and "Rake Tasks". Situation doesn't seem applicable.

UPDATE - Development Environment

<ul class="ui-autocomplete ui-front ui-menu ui-widget ui-widget-content ui-corner-all"_....

Answer №1

There seems to be an issue with the loading of the application.css manifest. Make sure that the code snippet below is included in the layout you are using:

<%= stylesheet_link_tag "application", media: "all" %>

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

What is the best way to align text vertically in a Bootstrap 4 button?

I have been searching on Google for an answer to this question, but so far I have not found a solution. I am currently working on a set of page controls and I am struggling to center my text vertically within the buttons. Below is my current html: <di ...

Spartacus 3.3 - Unleashing the Full Potential of the Default Sparta Storefront Theme

Looking for advice on how to customize the default Spartacus Storefront theme (Sparta) by only overriding specific CSS vars. Any suggestions? I tried following the instructions provided at: https://github.com/SAP/spartacus/blob/develop/projects/storefront ...

Is there a way to make my website mirror the exact layout it has on Codepen?

Recently, I started working on a web project on Codepen using Bootstrap 4 and JQuery quick-adds. The results were perfect on Codepen but when I copied the same code to my text-editor and ran it from there, the formatting of the page was completely off. I t ...

The jQuery find and replace feature is causing my entire content to be replaced instead of just specific paragraphs

Within this section, there are multiple paragraphs and an input field. The concept is simple: the user inputs text into the box, then hits "ENTER" to trigger a jquery function below. The process involves identifying matches between the paragraph content a ...

Fixed headers remain in place as you scroll horizontally on a single table

Within my system, I have organized two tables: table one and table 2 are stacked on top of each other. I've managed to freeze the column headers so that they are displayed vertically, remaining static as users scroll horizontally. To achieve this effe ...

Placing an absolute div directly at the boundaries of an inline span

In my project, I am working on adding a feature where text can be selected with the help of "handles." These handles have to be positioned either on the left or right side of the inline span. For reference, here is an image: https://i.sstatic.net/U1XGe.jp ...

Place the application bar at the bottom of the screen

https://i.sstatic.net/0B0Ad.png I am working on a project aimed at monitoring employees, and I have developed a user interface that allows for modifications within the site. However, there is an issue with the "bottom App Bar" section at the bottom of thi ...

How come the focus doesn't work when altering the CSS code simultaneously?

My attempt at creating a user interface involved an issue where the input field was not visible initially. After clicking the button, the input would appear on the screen, and I wanted to automatically focus on it. This is what I tried to achieve: Initial ...

What impact does the margin have on the alignment of my inline-block divs at the top using flex-start?

Embarking on my journey with CSS and HTML, I am eager to enhance my understanding. While attempting to align 3 divs in an inline block at the top of the flexbox section, I expected "align-items: flex-start;" to work, but unfortunately, the divs did not re ...

The file uploader on the HTML page only allows for PNG files to be uploaded

Currently, I am working on an application where I am facing a challenge related to file uploads. Specifically, I have an input field like this: <input id="full_demo" type="hidden" name="test[image]"> I am looking for a way to restrict the upload of ...

Mastering Fluent UI Web: Adjusting the border radius of a TextField component

I am in the process of creating a custom user input control that includes a TextField, a Dropdown, and a Button. To ensure that the TextField and Dropdown appear as a cohesive unit rather than two separate elements, I attempted to use two specific styles ...

Issue encountered while using the save! method in Rails version 3.1.0-rc6

I can't figure out what I am doing wrong. Here is the code snippet: new_model = Model.new(:brand_id=>brand_id, :name=>new_model_name) new_model.save! ModelImage.upload(new_model.id, params[:images]) However, new_model.id is nil. What could be ...

Designing a dynamic left navigation column with collapsible features

I'm currently exploring ways to integrate this style of sidebar navigation with the layout from my JSfiddle. In the first example, the sidebar collapses to the main icons, but the use of the Nav tag is causing it to slide under the content instead of ...

I require a breakdown of the JavaScript code, please

Are you struggling with a code snippet that involves CSS, JavaScript, and HTML? Let's take a look at the complete code: <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" href="http://snipplicious.com/css/bo ...

ng-token-auth lacks access control functionality

I am currently in the process of developing an Ionic App that utilizes ng-token-auth with a rails API supported by devise-token-auth. Recently, I completed the registration section as per the documentation provided. https://github.com/lynndylanhurley/ng- ...

Content for Bootstrap carousel items can be divided into two separate divs arranged horizontally

I'm currently working with a bootstrap carousel that displays images and text on each carousel item. However, I want the content of each carousel item to be displayed horizontally, rather than vertically as shown in the image below. Here is the curre ...

What is the best way to define a default font color across all components in a React project that utilizes Material

I'm working on a React application that utilizes Material UI. I've implemented my own theme override (see snippet below), but the font color needs to be changed to purple #391960 instead of rgba(0, 0, 0, 0.87). How can I adjust the default font c ...

What is the best way to utilize flexbox to create a table-like appearance with vertically centered columns and alternating row shading?

In my quest for vertically aligned columns using flexbox, I stumbled upon this solution: jsFiddle .container { display: flex; flex-direction: row; } .column { display: flex; flex-direction: column; margin: 0.3em; } .column > div:first-chil ...

Steps to prepend a domain to file_get_contents function in PHP script

Recently, I enlisted the help of a PHP coder to make modifications to two files for me. The purpose was to allow users to link directly to a file converted from DOC to IMG on . Below you can find the edited code (highlighted by 'DrTech76'): get ...

What is causing my browser to retrieve JSON response from Express?

Scenario: I've designed a website that features a form with a POST action. The objective is for users to input their email addresses into the form. Once an email is submitted, a POST request is dispatched to the server. By utilizing Express and the M ...