I follow this tutorial (except I put gem 'jquery-rails' in my gemfile ).
The problem, if I click to new post, and fill the form and click to create -> ajax don't work, and show method showing the simple post.
my create.js.erb:
$('body').html("
").append("");create method
def create
@post = Post.new(params[:post])
respond_to do |format|
if @post.save
format.html { redirect_to(@post, :notice => 'asdasd') }
format.js
else
format.html { render :action => "new" }
format.js
end
end
end
_form.html.erb
true) do |f| %>