[Rails] Extending update through checkboxes

2011-08-29 Thread Tom DeHart
I'm trying to figure out how to use check boxes to select multiple records and update them accordingly depending on what button a user presses (think GMail http://i.imgur.com/94DUi.jpg e.g., delete, archive, etc). There's a really great Railscasts

[Rails] Why do I sometimes have to refresh the page manually after an AJAX form submission?

2011-05-03 Thread Tom DeHart
When I do remote form submits through jQuery .submit() why do I sometimes have to refresh the page manually to see the results? My jQuery handler is very simple: $(#vote_yes).click(function() { $(#approval).val(true) $(.edit_vote).submit() }); And the link that leverages

[Rails] Can't figure out how to submit specific data with javascript

2011-05-01 Thread Tom DeHart
I'm unable to figure out how to submit specific data to a Rails update() method via the jQuery submit() method. This is the code snippet I'm working with: % form_for(vote, :remote = true) do |f| % %= check_box_tag selection, vote.id % % end % ... %= link_to 'Vote Yes', ballots_path,

[Rails] Very close to solution, can't figure out this bug with jQuery .submit()

2011-05-01 Thread Tom DeHart
First, a picture of what I'm doing: http://i.imgur.com/MO2o8.png A user should be able to select as many of these checkboxes and click on the Vote Yes or Vote No links (styled as buttons) to change their vote to yes or no (vote.approval = true or vote.approval = false). I got it working so that

[Rails] Re: Very close to solution, can't figure out this bug with jQuery .submit()

2011-05-01 Thread Tom DeHart
Frederick Cheung wrote in post #996132: Have you checked the browser's JavaScript console for any errors? That last line looks suspicious to me. I would have thought $ (value.form).submit() would suffice. Also I think this general approach might be built on slightly shaky approach - Since the