Created
July 7, 2009 20:58
-
-
Save wallace/142365 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # rails controller action renders text like this | |
| render :text => "alert('#{messages}');" | |
| # in response to a request that calls this js function onclick. | |
| function saveAsReport() { | |
| if (!currently_saving) { | |
| var name = prompt('Please enter a name for this new report.', $('report_name').value); | |
| if (name != null) { | |
| $('report_name').value = name; | |
| currently_saving = true; | |
| var querystring = $('queryForm').serialize(); | |
| var url = '/reports/create'; | |
| new Ajax.Request(url, { | |
| method: 'post', | |
| parameters: querystring, | |
| onSuccess: function(response) { | |
| //closeSaveModal(); | |
| eval(response.responseText); | |
| currently_saving = false; | |
| report_is_updated = false; | |
| $('save_btn').style.display = "none"; | |
| } | |
| }); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment