Skip to content

Instantly share code, notes, and snippets.

@hamannp
Created April 25, 2012 20:28
Show Gist options
  • Save hamannp/2493093 to your computer and use it in GitHub Desktop.
Save hamannp/2493093 to your computer and use it in GitHub Desktop.
Render rails form inside backbone view : Will it work?
window.ProfileEditView = Backbone.View.extend
template: null
el: $('#somecontainer')
initialize: () ->
this.el.html = this.getProfileEditform()
events: { "click .submit" : "submit" }
submit: () ->
this.el.html = @putProfileEditForm()
getProfileEditform: () ->
# do something Ajaxy with JQuery to GET /user/edit.html
putProfileEditForm: () ->
# do something Ajaxy with JQuery to PUT /user/update.html
window.ProfileEdit = new ProfileEditView()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment