rjs partial escaping

Hey all,

I have a calendar that's updateable via arrows which make ajax requests. The calendar is included in page using a partial, and the calendar loads fine, no problems. The arrows which make ajax requests call an action in the same controller which sets a new datestring five days in the future. There is a .rjs view associated with this action that renders the same partial I mentioned before.

Everything works fine, except I appear to be getting the source of the javascript, instead of the output from the view, so the calendar is filled with the try/catch statement, and all the values for the calendar are escaped (I can see the escaped quotes in the browser view).

Can anyone tell me what I'm doing wrong?

-josh

Josh Stephenson wrote:

Hey all,

I have a calendar that's updateable via arrows which make ajax requests. The calendar is included in page using a partial, and the calendar loads fine, no problems. The arrows which make ajax requests call an action in the same controller which sets a new datestring five days in the future. There is a .rjs view associated with this action that renders the same partial I mentioned before.

Everything works fine, except I appear to be getting the source of the javascript, instead of the output from the view, so the calendar is filled with the try/catch statement, and all the values for the calendar are escaped (I can see the escaped quotes in the browser view).

Can anyone tell me what I'm doing wrong?

-josh

>   

Check the code you are using on the arrow clicks, chances are you are using an :update => 'mydivname'. Get rid of the :update and its value, your RJS should be telling the page which div to update so this is redundant and is causing your javascript to print instead of run. There are a few other potential causes of this error but what I suggest is the most likely solution. Let us know if that does not work out for you.

Best of luck, Matt Margolis blog.mattmargolis.net

yup....you're right....removing :update => 'calendar' did it.

thanks!