Hello all,

I'm trying to create the following:

There is a index page that lists some items, and 'new item' button. I
want the user to be able to click the button, and with ajax the page
will be refreshed to show the new item form.

For that, I added a format.js on my controller, and created a
new.js.erb file for the action.

My problem is, how can I, inside the new.js template, print the
new.html action?

Something like this:
  $("#inner-content").html("<%= escape_javascript(render(:action =>
'new')) %>");

It doesn't work. Do I really have to create a partial for the entire
form to accomplish this?

Thank you!

--~--~---------~--~----~------------~-------~--~----~
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 rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to