Home arrow Ruby-on-Rails arrow Page 4 - Implementing Tagging Support
RUBY-ON-RAILS

Implementing Tagging Support


In this third part to a four-part article series on implementing tagging support for an ecommerce website using Ruby-on-Rails, you'll learn how to set up the application so users can assign tags to items. This article is excerpted from chapter seven of the book Practical Rails Projects, written by Eldon Alameda (Apress; ISBN: 1590597818).

Author Info:
By: Apress Publishing
Rating: 5 stars5 stars5 stars5 stars5 stars / 2
June 10, 2010
TABLE OF CONTENTS:
  1. · Implementing Tagging Support
  2. · Modifying the View
  3. · Modifying the Controller
  4. · Changing the Style Sheet

print this article
SEARCH DEVARTICLES

Implementing Tagging Support - Changing the Style Sheet
(Page 4 of 4 )

The list that displays the tags has a white background, which makes it difficult to tell apart from the rest of the page. Remember that the autocompletion field uses adivelement to show the list of tags. Thedivhas been assigned theid #tags_update, so it is easily fixed by adding the following style topublic/stylesheets/style.css:

#tags_update {
  font-size: 75%;
  font-weight: normal;
  color: white;
  margin: 0px;
  padding: 0px;
  border:1px solid black;
  background-color: #B36B00;
}

Also add the following style to highlight a tag when you move your mouse over it:

#tags_update li:hover {
  text-decoration: underline;
}

Reload the page and add a new book again. This time, you should see the tags in a brown box, as shown in Figure 7-2. You can double-click a tag to add it to the list.


Figure 7-2.  The Tags field with autocompletion

Please check back tomorrow for the conclusion to this series.


DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware.

blog comments powered by Disqus
RUBY-ON-RAILS ARTICLES

- Ruby-on-Rails Faces Second Security Flaw in ...
- Ruby 2.0 Prepped for February 2013 Release
- Why LinkedIn Switched from Ruby on Rails
- Adding Style with Action Pack
- Handling HTML in Templates with Action Pack
- Filters, Controllers and Helpers in Action P...
- Action Pack and Controller Filters
- Action Pack Categories and Events
- Logging Out, Events and Templates with Actio...
- Action Pack Sessions and Architecture
- More on Action Pack Partial Templates
- Action Pack Partial Templates
- Displaying Error Messages with the Action Pa...
- Action Pack Request Parameters
- Creating an Action Pack Registration Form

Watch our Tech Videos 
Dev Articles Forums 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us 
Weekly Newsletter
 
Developer Updates  
Free Website Content 
Contact Us 
Site Map 
Privacy Policy 
Support 

Developer Shed Affiliates

 




© 2003-2018 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap
Popular Web Development Topics
All Web Development Tutorials