html form and form_for

This is just me, but I'd make them both buttons and assign a
javascript function to the onclick events. In the function, I'd grab
the form via prototype, set the action accordingly, then submit it.
There's probably a more Rails-pure way of doing it, but I generally
go with what works first.

Peace,
Phillip

Hi Jeremy,

Sorry to state the obvious here, but there's only one way for your JS
skills to get better...code it. I've been writing JS for less than a
year, and while I don't have the knowledge or skills to work on
Prototype or Scriptaculous (or any other wonderful library), I can
look at it and understand it (for the most part). Heh, I remember
the first little JS thing I did. I was "Oh! That's so cool!" But you
have to start somewhere.

For this purpose, your code is going to look something like:

<input type="button" id="close_button" value="Close Ticket"
onclick="close_ticket();" />
<input type="button" id="assign_button" value="Assign Ticket"
onclick="assign_ticket();" />

function close_ticket()
{
  var f = $('ticket_form');
  f.action = 'url to closing ticket';
  f.submit();
}

function assign_ticket()
{
  var f = $('ticket_form');
  f.action = 'url to assigning ticket';
  f.submit();
}

Assuming you have no special logic for either closing or assigning,
you can make this a single function and pass in some value that
indicates what you want to do:

function submit_form(action)
{
  var = $('ticket_form');

  if (action == 'close')
  {
    f.action = 'url to close';
  }
  else
  {
    f.action = 'url to assign';
  }

  f.submit();
}

then both buttons would call the same function:

<input type="button" id="close_button" value="Close Ticket"
onclick="submit_form('close');" />
<input type="button" id="assign_button" value="Assign Ticket"
onclick="submit_form('assign');" />

I haven't tried this code, so there might be some holes, but the
theory is sound. There are also other ways you could change it here
and there to make it more compact and dry. I'll leave that to you.

Ahh...after taking from the community for so long, it's good to
finally be able to give something back.

Peace,
Phillip