Changing visual_effect defaults

what is the correct syntax for changing an effect like :highlight? i
tried looking through the api, and found it, but i can’t seem to get it

i want to change the start color of visual_effect(:highlight,
‘user-list’). i tried visual_effect(:highlight, ‘user-list’, :startcolor
= ‘#990000’) and several other variations of that, but i can’t seem to
get it right.

i think i have solved that problem. i ended up with:
visual_effect(:highlight, ‘user-list’, { “startcolor” => “’#990000’” })

but i do have another question. the visual_effect changes the entire
list. how can i extract the id of the item that was moved so that i
could have an effect on just that item?

here is the script i am using -

in my view:

<%= @user_list.full_name %>'s Tasks

    <% @user_list.tasks.each do |task| -%>
  • <%= task.task_name %>
  • <% end %>
<%= sortable_element 'user-list', :url => { :action => 'sort', :id => @user_list }, :complete => visual_effect(:highlight, 'user-list', { "startcolor" => "'#990000'" }) %>

in my controller:
def sort
@user_list = User.find(params[:id])
@user_list.tasks.each do |task|
task.position = params[‘user-list’].index( + 1
render :nothing => true

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs