Im working with a GEM call best_in_place : https://github.com/bernat/best_in_place
Creation of new todo items are done with:
<%= best_in_place @user, :name, :type => :input, :nil => "Click me to add content!" %>
respond_to :html, :json, :js
def todo_item_fast_create
@todo_list = TodoList.find(params[:id])
@todo_item = @todo_list.todo_items.new(params[:todo_item])
@todo_item.save
respond_with @todo_item
end
The response code is JSON, but I would like to call a JS template so I can manipulate the DOM, is that possible?