Re: Javascript with select in partial

RVince
Tue, 01 Sep 2009 10:42:40 -0000

Hassan,

Yes, I think I almost have it now. In my controller I have replaced

render :partial => ''channelnotesfield''

with what you have:

render :update do |page|
      page.replace ''channelnotesfield'' , :partial =>
''channelnotesfield''
    end

And that does seem to invoke things. However, when I do it your way
not, on subsequent calls to replace channelnotesfield in my
controller, I get a dialog box that says:

RJS Error:

TypeError: element is null

Clicking OK, another dialog box appears, saying:

Element.replace("blah blah the code of my partial")

All I am doing is calling my partial /views/channels/
_channelnotesfield.html.erb from the controller ChannelsController as
shown above. Any idea what I dont have quite right here? Thanks again!
-RVince