# Javascript color picker yields strange errors

**URL:** <https://www.ruby-forum.com/t/javascript-color-picker-yields-strange-errors/136418>\
**Category:** Rails\
**Created:** [May 1, 2008, 10:32pm UTC](https://www.ruby-forum.com/t/javascript-color-picker-yields-strange-errors/136418 "2008-05-01T22:32:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![railsdog](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/b77776/32.png) [@railsdog](https://www.ruby-forum.com/u/railsdog)\
**Post date:** [May 1, 2008, 10:32pm UTC](https://www.ruby-forum.com/t/javascript-color-picker-yields-strange-errors/136418/1 "2008-05-01T22:32:17Z")

</div>

First off, I am by no means Javascript-literate… but this little tool  
looks promising or what I have in mind:

[http://www.knallgrau.at/code/colorpicker](http://www.knallgrau.at/code/colorpicker)

I have it working ot the point where my users can select their  
preferences, click a field to change color, and the javascript control  
appears, except that I don’t get the slider control shown, nor the  
shading on the color, etc, etc.

In my logs, I see

ActionController::RoutingError (No route matches  
“/userprefs/edit\_me/images/hue.png” with {:method=\>:get}):

where the colorPicker.js is trying to build the control with statements  
like this:

blah blah blah…  
‘ ![]()’

blah blah blah.

I’ve tried setting the IMAGE\_BASE in the \_form code where the javascript  
controls are created like this:

```
new Control.ColorPicker("userpref_site_back", { IMAGE_PATH :

```

“/images/”});

but the path ends up including the controller and action.

I must be missing something. Of course, if I knew what it was, I  
wouldn’t be missing it…

Thanks in advance for any ideas.
