innerHtml is not a function. innerHTML is.
Larry On Tue, Mar 16, 2010 at 6:25 AM, Ignace S. <[email protected]> wrote: > Hey, > I'm looking for a way to get the content of my div in my Rails view. I > would like the literal HTML content, so only HTML and no Rails > I thought inner_html would work, but I get a RJS exception (TypeError: > $("content").innerHtml is not a function) > > Does anyone know how I can get the content? Thanks! > > In my controller I use this code: > [code] > def save_test > render :update do |page| > page['content'].innerHTML > end > end > [/code] > > Some more context maybe? I get a HTML form (without the form tags > themselves) and put it into a rails form. What I want is that the user > changes checkboxes, radiobuttons, fills out input fields etc and when > the user saves, I want the literal changed content of the form as a > string to save it to my database. > The reason for this is that the several provided forms differ a lot and > it's only used as information, no calculations etc need to be done on > it. > So my view looks like this: > > [code] > form_remote_tag :url=>{:action => 'save_trainee_evaluation' do %> > <div id="content"> > <%= contract_trainer_trainee.evaluation_template %> > </div> > <%= submit_tag 'Opslaan' %> > > <% end %> > [/code] > -- > Posted via http://www.ruby-forum.com/. > > -- > You received this message because you are subscribed to the Google Groups > "Ruby on Rails: Talk" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/rubyonrails-talk?hl=en. > > -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

